IPB

Welcome Guest ( Log In | Register )

[ Outline ] · Standard · Linear+

 Now You See It, Now You Don't, In need of an if/then

InfiniteWarrior
post Oct 2 2005, 02:58 PM
Post #1


Emperor


Group: Members
Posts: 800
Joined: 21-June 03
Member No.: 20



For the option to turn styles off and on, I'm using this little snippet:

CODE
<?php
if( $_GET['css'] != 'false' )
{
?>
 <link rel="stylesheet" href="style.css" type="text/css" />
<?php
}
?>


... and the links:

CODE
<a href="?css=false">Styles Off</a> | <a href="?css=true">Styles On</a>


... meaning both links are visible at all times. What I'd like to do is make one or the other disappear depending on which has been selected: "Styles Off" becomes "Styles On" and vice versa.

Any of you youngsters wanna help out an old lady?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Replies
TheLizardKing
post Oct 3 2005, 09:53 PM
Post #2


Secretive Rodian Lover Hater


Group: Admin
Posts: 93
Joined: 13-June 03
From: Orlando, Florida, United States of America
Member No.: 1



For the variables, all you have to do is place that bit of code (its not 100% syntax correct) near the top and place the header variable in the header and the link variable where the link is

html <?php echo $linktext; ?> morehtml

and for the persistant memory, you are gonna want to look into sessions. Unfortunately I am not the master of sessions so I can't help much there sad.gif


--------------------
AS;LDJFA;LSKFADS
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic


Topic Options
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
 

Lo-Fi Version Time is now: 24th April 2024 - 10:34 AM