trying to take code from MySQL and use as CSS
Posted: Sat Feb 20, 2010 1:56 pm
Hi all
I am trying, and failing, to provide CSS code to the headers on an HTML page.
The CSS is typed and saved into an SQL database using the mysql_real_escape_string and htmlspecialchars functions.
I then want to pull this back as part of the HTML header section, example...
the raw.php file reads the 'p' parameter and extracts the 'test2' entry from SQL and echo's it.
The problem is that the HTML page does not use the CSS echo'd by my PHP code. If I refer to one of the classes defined in the CSS is is ignored by the HTML.
If I simply visit the page ... raw.php?p=test2 the results look fine
I must be missing something.
any thoughts?
thanks
I am trying, and failing, to provide CSS code to the headers on an HTML page.
The CSS is typed and saved into an SQL database using the mysql_real_escape_string and htmlspecialchars functions.
I then want to pull this back as part of the HTML header section, example...
Code: Select all
<link rel="stylesheet" type="text/css" media="screen" href="raw.php?p=test2" />Code: Select all
$result = mysql_query($page_qry);
$row = mysql_fetch_array($result);
if ($row)
{
echo htmlspecialchars_decode($row['content']);
}If I simply visit the page ... raw.php?p=test2 the results look fine
I must be missing something.
any thoughts?
thanks