I need a PHP script that will change the layout of a webpage, i.e., some images and the .css file that it is linked to. How do you do that?
Please help me.
If you don't understand what I am trying to say, please visit the following site and see their layout changer:
This is not as hard as it looks for the first time.
Make a page using divs & CSS. Copy the CSS to several different names and change the values of colours, pictures and anything you want.
Start your index.php like this:
if (isset($_COOKIE['stylesheet'])) $stylesheet=$_COOKIE['stylesheet'];
then later on, in the head section:
|<link rel="stylesheet" type="text/css" href="<?php echo('./styles/'.$stylesheet) ?>.css" /> |
And to actually change the styles:
|<form name="stylesheet" action="setstyle.php" method="get">
<option value="default">Default Style</option>
<option value="second">Style 2</option>
<option value="third">Style 3</option>
<input type="submit" value="Let's see..." />
NOTE: name your style sheets according to the option values! (default.css, second.css, etc.)
The setstyle.php mentioned in the action property:
I hope it helped.
|Nyizsa wrote: |
Not necessary, for each pitcture you can make a seperate form with a hidden field with name="stylesheet" value="default/style1/style2" then use the following code to make an image button:
<img alt="name of style for users without images" src="urlofimage.png" />
Then optionally remove the button border using css