Jump to content
Sign in to follow this  
gmz1023

Switch Question

Recommended Posts

Okay. Hi y'all i'm rather new to PHP so please excuse my stupidity.I'm currently working with a Switch and i was wondering how to--if possible at all--add a second variable into the same page. for instanceI want to be able to type this into my browser:www.mysite.com/index.php?scs=blahand get a certain section of my site. and likewise i woudl like to type:www.mysite.com/index.php?atp=blahand get a different part. I've already got both variables set up but the problem is i have a Default set up on the first variable that needs to stay. the switch code looks like this

$scs = $_GET['scs'];@include('pt1.php');switch($scs){default:@include('vm9.php');break;case vstr:@include('vst/v1.php');break;}$atp = $_GET['atp'];switch($atp){    case credits:    @include('atp/credits.php');    break;}

thanks in advance for the help.

Edited by gmz1023

Share this post


Link to post
Share on other sites

Also, the default case has to go at the end.

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...