Reputation: 33
Well I want stylesheet URLs to be stored in the database, and change the stylesheets href by variables in html tags.
But nothing happen when i using this code:
global $theme_addresss;
global $showdetail_dbtadbirusers;
require 'displaycustomersdb.php'; /*this file store usercode in variable via session*/
$sql_changetheme = mysqli_query($link, "SELECT profile_theme FROM tusers WHERE usercodecode='{$usercodecode}'");
$sql_result_changetheme = mysqli_fetch_array($sql_changetheme);
$theme_addresss = $sql_result_changetheme['profile_theme'];
<link rel="stylesheet" href='<?php echo $theme_addresss; ?>'>
Upvotes: 0
Views: 150
Reputation: 33
I find out what is the problem, the code is fine. i just put <link rel="stylesheet" href="<?php echo $theme_addresss; ?>">
into the other page of my website and it worked!
Upvotes: 1
Reputation: 76
Can you try change single quote to double quote around href and see if it works?
<link rel="stylesheet" href=“<?php echo $theme_addresss; ?>”>
Upvotes: 0