PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Jul 07, 2020 11:46 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jul 14, 2005 12:08 pm 
Offline
Forum Commoner

Joined: Wed Jun 22, 2005 10:22 am
Posts: 56
Location: Minneapolis, MN


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2005 1:20 pm 
Offline
BeerMod
User avatar

Joined: Tue Jan 13, 2004 5:58 pm
Posts: 2170
Location: Jax FL & Spokane WA USA
Here is a cleaner example of your conditional statement.
Syntax: [ Download ] [ Hide ]
if (isset ($_POST['submitstyle']))

        $url = $_POST['submitstyle'];

elseif (isset ($_SESSION['style']))

        $url = $_SESSION['style'];

elseif (isset ($_COOKIE['cookiestyle']))

        $url = $_COOKIE['cookiestyle'];

else

        $url = 'http://www.dustinyonak.net/2col_rightNav.css';



echo '<link rel="stylesheet" href="' . $url . '" type="text/css" />';


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2005 2:03 pm 
Offline
Forum Commoner

Joined: Wed Jun 22, 2005 10:22 am
Posts: 56
Location: Minneapolis, MN
Much cleaner, thanks hawleyjr. One thing though, the:

Syntax: [ Download ] [ Hide ]
$url = $_POST['submitstyle'];


should be:

Syntax: [ Download ] [ Hide ]
$url = $_POST['style'];


Worked great other than that, thanks again.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group