Thanks a lot

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!
header( "Location:index.php?act=blablabla");
if (!isset($_GET["act"])) header("Location:index.php?act=blablabla");
<? header("Location: http://www.msn.com"); ?>is an example of what I use as a redirect code. I need to place several of these into redir.php and be able to choose which one I want via the address bar. I have tried this for the redirect code
$msn = header("Location: http://www.msn.com"); ?>and typed this ini the address bar
redir.php?$msnBut nothing happens.
<?php switch ($_GET["act"]) { case "msn": header("Location: http://www.msn.com"); break; case "yahoo": header("Location :http://www.yahoo.com"); break; } ?>
Edited by Hai Mac, 31 December 2005 - 03:04 PM.
<?php switch ($_GET["act"]) { case "[color=#3333FF]google[/color]": header("Location: [color=#FF0000]http://www.google.com[/color]"); break; } ?>The text in blue is what you will need to type in the address bar after the ?act=, for mine I used a number, but you can use any name you want. for this redirection script you will need to type name of your file.php?act=google to use the google redirection. You can change the text in red to any url you want.
<?phpStarts the php script
switch ($_GET["act"])means it will use the GET method to check if the ?act= is in the address bar
{starts the main redirect code
case "google":Specifies what you need to type after the ?act=. It can be anything you want.
header(Location:http://www.google.com");Specifies where the page should send the user after the ?act=google is entered in the address bar.
break;I do not yet know what this means.When i do I will update this. If someone knows let me know
}Ends the main redirect code
?>Ends the php script
<a href=name of your redirect page.php?act=googleSave it and test it. I have found that testing the scripts is a very important part of the scripting process. I created a special folder called test that I do this in.
Edited by Hai Mac, 31 December 2005 - 03:54 PM.
0 members, 1 guests, 0 anonymous users
Community Forum Software by IP.Board
Licensed to: Geeks to Go, Inc.