Arianna
11-29-2009, 12:46 PM
I want to convert my templates to PHP, for a feature that I'm making. You see, the theme url is 'blue.php', and it has a few things which are PHP in it.
What, you ask? Well, this is the code in between the head tags:
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>:BROWSERTITLE:</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<?php
$sql = "SELECT * FROM ".$prefix."users WHERE username='".$loggedinname."'";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$stylesheet = $myrow['style'];
?>
<link rel="stylesheet" media="screen" type="text/css" href="templates/blue/default.css" title="default" />
</head>
I have this working on another site of mine, but the system doesn't seem to be able to read the actual php file - the css link is shown as:
templates/blue/blue.php<?php echo $stylesheet ?>.css
This is instead of it echoing the variable. What am I doing wrong?
What, you ask? Well, this is the code in between the head tags:
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>:BROWSERTITLE:</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<?php
$sql = "SELECT * FROM ".$prefix."users WHERE username='".$loggedinname."'";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$stylesheet = $myrow['style'];
?>
<link rel="stylesheet" media="screen" type="text/css" href="templates/blue/default.css" title="default" />
</head>
I have this working on another site of mine, but the system doesn't seem to be able to read the actual php file - the css link is shown as:
templates/blue/blue.php<?php echo $stylesheet ?>.css
This is instead of it echoing the variable. What am I doing wrong?