So i've set up user profiles on one of my sites to enable users to add custom colours and change the background. Only thing is the CSS only shows up sometimes on Firefox and in IE it doesn't even appear in the source code :icon_confused: Anyway here's the PHP used to generate the CSS code:
<?php
$result1 = mysql_query("SELECT * FROM user_css WHERE loginname='$loginname'");
if((mysql_num_rows($result1) != 0) && ($_GET['page'] == "profile")){
while($row1 = mysql_fetch_array($result1)){
echo'<style type="text/css">
fieldset{
color: '.$row1['text'].';
border-color: '.$row1['fieldset'].';
}
legend{
color: '.$row1['legend'].';
}
strong, h1{
color: '.$row1['strong'].';
}
h1{
border-color: '.$row1['strong'].';
}
.user_css{
background-color: '.$row1['back_col'].';
background-image: url('.$row1['back_img'].');
background-position: '.$row1['back_pos'].';
background-repeat: '.$row1['back_rep'].';
}
</style>';
}
}
?>
Thanks