Iam stylesheet.php içine mysql veritabanından veri almak için çalışıyoruz ama çalışmıyor.
ana sayfa:
<link rel="stylesheet" href="includes/dynamicstyle.php" media="screen">
stylesheet.php
<?php header("Content-type: text/css;"); ?>
<?php
require 'connect.php';
$userid = $_SESSION['uid'];
$select_query = "SELECT * FROM theme where user_id = $userid";
$primaryTextColor = '#336600';
$secondaryTextColor = '#fff';
$tertiaryTextColor = '#555';
$primaryBGColor = '.$background.';
$secondaryBGColor = '#ccc';
$tertiaryBGColor = '#000';
$primaryTextSize = '10'; //pixels
?>
#pro_theme{
color: <?php echo $primaryTextColor?>;
background: <?php echo $primaryBGColor?>;
}
#con_theme {
background: <?php echo $secondaryBGColor?>;
font-size: <?php echo 1.1*$primaryTextSize ?>px;
}
#des_theme{
background: <?php echo $secondaryBGColor?>;
font-size: <?php echo 1.1*$primaryTextSize ?>px;
}
#basic{
background: <?php echo $secondaryBGColor?>;
}
<?php
$result_select = mysql_query($select_query)or die(mysql_error());
if ($result_select){
$row = mysql_fetch_assoc($result_select);
$background = $row['background'];
}
?>
Bu çalışma için beni değil, ben sadece bilmek istiyorum bir doğru yolu yapmak olduğunu ya da bir şey, bunu yapmanın daha iyi bir yol yoktur.
teşekkürler.
Edit:
Tavsiye, onun şimdi çalışma için teşekkürler.