Session & if question
Posted: Thu Jan 29, 2004 9:45 pm
Okay now I'm trying to setup my site to have 2 different layouts. Now currently the site is programmed in php.
What I was thinking about doing was if someone wanted to change the layout they could simply click a link and it would set a cookie or I believe a session(?) as it's called in php. Now from there whenever someone comes to the site inside the index.php there would be an if statement that would look something like this:
<?php
if()
{
include("top.shtml");
include("middle.shtml");
include("bottom.shtml");
}
else
{
include("top2.shtml");
include("middle2.shtml");
include("bottom2.shtml");
}
?>
Now I don't know if this would work, but in theory I think it would. I'm just wondering what code would I need to make a link to create a session, and then from there what statement would I need to have for the if statement to work?
Thanks.
What I was thinking about doing was if someone wanted to change the layout they could simply click a link and it would set a cookie or I believe a session(?) as it's called in php. Now from there whenever someone comes to the site inside the index.php there would be an if statement that would look something like this:
<?php
if()
{
include("top.shtml");
include("middle.shtml");
include("bottom.shtml");
}
else
{
include("top2.shtml");
include("middle2.shtml");
include("bottom2.shtml");
}
?>
Now I don't know if this would work, but in theory I think it would. I'm just wondering what code would I need to make a link to create a session, and then from there what statement would I need to have for the if statement to work?
Thanks.