Ive made a simple tab menu system. When you click one tab it sets some variables so that one is down and the rest are up ie tab1=down, tab2=up. I'm having problems declaring the variables in the first place though. If I put

<?
$tab1=down;
$tab2=up;
?>

Then everytime the page loads it uses those variables and cancels out any others set by clicking a tab. The code I need for this to work is very simple I think but I dont know what it is, something like

<?
if $t1=""; (if t1 has no value yet)
$t1=down (set these values)
$t2=up
?>

I would greatly appreciate some help. Cheers

    Does this help any???

    <?
          $t1 = $_GET['tab1'];
          $t2 = $_GET['tab2'];
    
      if(!isset($t1)) // If $t1 is not set...
      {
          // assign values:
            $t1 = 'down';
           $t2 = 'up';
       }
       else // Else...
       {
            $t1 = 'up';
            $t2 = 'down';
        }
    ?>
    

    Then, make your tab links like:

    file.php?tab1=$t1&tab2=$t2

      Write a Reply...