im working on a video on demand project which is built which php, html, javscript and mysql as well as some other scripting. im wont get into the workings of the system but i need help figuring out a small matter.
im currently working on the cms which will handle amongst other things, the ability for the front desk to be able to change the style of the product. this kind of change will most likely only happen once, when the product is implemented in the clients premises but the ability to change between styles must remain. i can use javascript but its glitchy and i need a solid solution. so my thinking is to use dynamic css. ive been reading how to do this but cant find the solution i need. as mentioned, the front office who will be administering the system with the cms, need to be able to change the style of the pages which will be delivered. as such, there has to be a form to be able to switch styles as well as a folder holding my styles.
the bit i cant figure out is how best to call the css to the page once its selected. im currently tricking with the following which as it is, is not working as in the html displays minus the css. this is just experimental code. html form is first and is called styles.htm
the actual page is then called start.php
so has anyone done this or does anyone know the correct way to do it? im going to trick around with a switch which ive been creating but have already been having problems with. ie my form cant seem to pull data from the switch
ps i dont want to use cookies or a session. this has to be permanent until its changed by the front office
im currently working on the cms which will handle amongst other things, the ability for the front desk to be able to change the style of the product. this kind of change will most likely only happen once, when the product is implemented in the clients premises but the ability to change between styles must remain. i can use javascript but its glitchy and i need a solid solution. so my thinking is to use dynamic css. ive been reading how to do this but cant find the solution i need. as mentioned, the front office who will be administering the system with the cms, need to be able to change the style of the pages which will be delivered. as such, there has to be a form to be able to switch styles as well as a folder holding my styles.
the bit i cant figure out is how best to call the css to the page once its selected. im currently tricking with the following which as it is, is not working as in the html displays minus the css. this is just experimental code. html form is first and is called styles.htm
Code:
<html>
<head></head>
<body>
<form action="start.php" method="post">
What stylesheet would you like to use? <input type="text" name="msg" size="30">
<input type="submit" value="send">
</form>
</body>
</html>
the actual page is then called start.php
PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>video service</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" media="all">
<?php
$style=$_POST['msg'];
if ($style == "style1"){
echo "
@import \"css/main.css\"\;
body {
background-color: #FFFFFF;
background-image: url(images/bg1.png);
}
";} elseif ($style == "style2") {
echo "
@import \"css/main2.css\"\;
body {
background-color: #ffffff;
}"
;}
?>
</style>
</head>
<body>
<div id="page">
<div id="head" height="100%"><h1>
<p> ..........this is the header div</p>
</h1>
</div>
<div id="content" height="100%"><h1><br>
..........Content div</h1>
<h1><---<--- will need border <br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</h1>
</div>
<div id="foot" height="100%"><h1>
<p>.....this is the foot div</p>
</h1>
</div>
</div>
</body>
</html>
so has anyone done this or does anyone know the correct way to do it? im going to trick around with a switch which ive been creating but have already been having problems with. ie my form cant seem to pull data from the switch
ps i dont want to use cookies or a session. this has to be permanent until its changed by the front office