Jump to content

Including a switch in a switch


legohead6

Recommended Posts

im making a thing kinda like when you dial a phone to a company (I.E press 1 for english, 2 for french.....then when you hit 1 it comes up hit 1 to talk to sales...hit 2 to talk to customer support...etc..etc)you know what i mean.....well in order to do this i used switch... but it doesnt seem to work...because it requires a switch to be inside a switch... heres the page....
[a href=\"http://www.mattswebpage.com/other%20tests/phoneline%20idea.php\" target=\"_blank\"]Phone line idea[/a]

and heres the script(no switches inside switches yet)
[code]<html>
<form name="p1" method="GET">
<b>Step 1:</b><br>Press 2 to go to mattswebpage<br>
Press 1 to go to splatmen<br>
Press 3 to go to LIFD<br>
<input type="text" name="ppp" size="2" value="0">
<input type="submit" name="submit1" value="Next">
</form>
<?php
if(isset($_GET['submit1'])){
$ppp=$_GET['ppp'];
switch($ppp){
case '0':
echo "Please Enter a number from 1-3!";
break;
case '1':
echo "<b>Step 2:</b><br>Forums Press 1<br>
Home Press 2<br>
chat room Press 3<br>
<form name='p2' method='get'><input type='text' name='pp2' value='0' size='2'><input type='submit' name='submit2' value='Next'></form>";
$pp2=$_GET['pp2'];
break;
case '2':
echo "<b>Step 2:</b><br>Forums Press 1<br>
Home Press 2<br>
chat room Press 3<br>
contact Press 4<br>
<form name='d3' method='post'><input type='text' name='pp3' value='0' size='2'><input type='submit' name='submit3' value='Next'></form>";
break;
case '3':
echo "this would look something like the others.....";
break;
case '4':
echo "this isnt a valid number";
break;
}
}    
?>[/code]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.