Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Query

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
How do I make a query like index.php?action=main, that way i can redirect them into different places depending on the action query.
 
simple ...

with a switch

switch ($action){
case 1 : Header("Location: URL1"); break;
case 2 : Header("Location: URL2"); break;
...
default: Header("Location: URL_Default"); break;
}

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
you can take the result into a script where u test the $action variable and depending on this, u redirect to the appropriate page

redirect.php

<?php
switch ($action){
case someaction:
header(&quot;location: &quot;);
break;
case anotheraction:
header(&quot;location: &quot;);
break;
.
.
.
default:
header(&quot;location: &quot;);
}

?>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top