charlesliumy 0 Newbie Poster

Hi, I'm trying to built / link 3 drop down menu's: but I can't seem to get the 3rd drop down menu, and the answer below to work right. can someone please offer some guidance?

<body>
<?php   

$p=$_GET["p"];
$q=$_GET["q"];
?><br>
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
  <option >Select Your Topic</option>
  <option value="?p=1" <? if($p==1){ echo "selected";} ?>>Ordering Questions & Answers</option>
  <option value="?p=2" <? if($p==2){ echo "selected";} ?>>Authorization & Access Codes (membership)</option>
  <option value="?p=3" <? if($p==3){ echo "selected";} ?>>Product (online and material) Questions</option>
  <option value="?p=4" <? if($p==4){ echo "selected";} ?>>Help Using More.Starfall.com and Starfall.com (Tech Support)</option>
  <option value="?p=5" <? if($p==5){ echo "selected";} ?>>Browser and Bandwidth Troubles</option>
  <option value="?p=6" <? if($p==6){ echo "selected";} ?>>Misc</option>
</select><br>
<?


if($p!="")
{ 
switch ($p)
{
case 1:
 ?>
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
  <option >Ordering Questions & Answers</option>
  <option value="?p=1&q=1" <? if($q==1){ echo "selected";} ?>>What forms of payment do you accept?</option>
  <option value="?p=1&q=2" <? if($q==2){ echo "selected";} ?>>How can I get free materials</option>
  <option value="?p=1&q=3" <? if($q==3){ echo "selected";} ?>>How do I order The Starfall Kindergarten Curriculum? </option>

</select>
 <?
  break;
case 2:
 ?>
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
  <option >Authorization & Access Codes (membership)</option>
  <option value="?p=2&q=19" <? if($q==19){ echo "selected";} ?>>What is an access code?</option>
  <option value="?p=2&q=20" <? if($q==20){ echo "selected";} ?>>I have an access code, how do I use it?</option>
  <option value="?p=2&q=21" <? if($q==21){ echo "selected";} ?>>Someone has already entered my Access Code</option>
</select>
<?
}
}


if($q!="")
{ echo "<br>";
switch ($q)
{
case 1:
 ?>	
  <select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
  <option >What forms of payment do you accept?</option>
  <option value="?q=1&r=1" <? if($r==1){ echo "selected";} ?>>Credit card (online, phone and fax)</option>
  <option value="?q=1&r=2" <? if($r==2){ echo "selected";} ?>>Paypal (online only)</option>
  <option value="?q=1&r=3" <? if($r==3){ echo "selected";} ?>>Phone, Mail or Fax (form)</option>
</select>
<?
}
}

if($r!="")
{ echo "<br><br>";
switch ($r)
{
case 1:
  echo "Credit card (online, phone and fax)?";
  echo "<br>";
  echo "Joining online gives you instant access to More.Starfall.com. Simply click here and follow the instructions. You will be prompted to select a membership type and enter your credit card information. You may also pay by PayPal.";
   break;
 
case 2:
  echo "Paypal (online only)";
  echo "<br>";
  echo "You will be prompted to select a membership type and enter your credit card information. You may also pay by PayPalJoining online gives you instant access to More.Starfall.com. Simply click here and follow the instructions. .";
  break;
  
default:
  echo "No question found";
}
}

?>
</body></html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.