Altering site HTML based on user selection
If anyone could give me PHP code on how to do this, I would be very grateful. I'm making a site for my company, and their breathing down my back. Just send it to the following e-mail:
Thanks!!
If anyone could give me PHP code on how to do this, I would be very grateful. I'm making a site for my company, and their breathing down my back. Just send it to the following e-mail:
Thanks!!
master7 posted this at 01:48 — 4th September 2001.
They have: 4 posts
Joined: Sep 2001
An example of this is http://www.jedilegacy.net
a_gajic posted this at 09:19 — 4th September 2001.
They have: 71 posts
Joined: Aug 2001
This is actually quite a simple code, if your running templates in PHP then set all of the colours as variables like this: "> right then down to the code...
<?php
if ($usr_select == "red") {
// Set the variables
$font_color1 = FFFF00;
$table_bgcolor1 = FF0000;
// Include your header to the page
include("header.php");
// Include the pages main content
include("about.php");
// Include the footer to the page
include("footer.php");
}
elseif ($usr_select == "blue") {
// Set the variables
$font_color1 = 00ADDD;
$table_bgcolor1 = 000080;
// Include your header to the page
include("header.php");
// Include the pages main content
include("about.php");
// Include the footer to the page
include("footer.php");
}
else {
// The plain background of the site, defaults
// Set the variables
$font_color1 = 000000;
$table_bgcolor1 = FFFFFF;
// Include your header to the page
include("header.php");
// Include the pages main content
include("about.php");
// Include the footer to the page
include("footer.php");
}
?>
If you wanted to use the content inside the script..it would be a long long script. But here's how you would go about doing it, in the if/elseif commands do something like this;
if ($page == "about" && $usr_select == "red") {
// All your PHP stuff here
// Underneath all that add some content in HTML
?>
MY HTML PAGE
<?php
include("footer.php");
}
Get it?
master7 posted this at 20:32 — 4th September 2001.
They have: 4 posts
Joined: Sep 2001
Thanks!!
a_gajic posted this at 21:49 — 4th September 2001.
They have: 71 posts
Joined: Aug 2001
no problem
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.