-
[HELP] PHP scripting
I'm trying to enable switching of css by the users of a site I'm developing.
I've managed to enable the switching of css and storing the info using sessions.
My problem is, whenever the session is destroyed, the site uses no css.
How can I force the default css when session is not set?
Code:
//enable switching styles
if (isset($_GET['style'])) {
if (isset($_SESSION['style'])) {
$_SESSION['style'] = $_GET['style'];
} else {
$_SESSION['style'] = "default";
}
}
$style = $_SESSION['style'];
Any help is appreciated, thnx :)
-
Re: [HELP] PHP scripting
Code:
if (isset($_GET['style']) && isset($_SESSION['style']))
{
$_SESSION['style'] = $_GET['style'];
}
else
{
$_SESSION['style'] = 'default.css';
}
$style = $_SESSION['style'];
-
Re: [HELP] PHP scripting
thank you very much, I new it was simple....works perfect :P
-
Re: [HELP] PHP scripting
If Your Still Looking For A Better Answer You Could Just Store The Name In A Cookie And Get It When The Website Needs It.