13
Jan
Simple PHP Redirector
Posted January 13, 2010 by Dushi in HTML, PHP. Tagged: HTML, Internet, PHP. 2 Comments
This code represents a simple PHP redirector for your web site
.

php_redirector
PHP_Redirector.php
<?php
if($_POST[choice] == “google”)
{
$selection = “http://www.google.lk”;
}
elseif($_POST[choice] == “yahoo”)
{
$selection = “http://www.yahoo.com”;
}
elseif($_POST[choice] == “bing”)
{
$selection = “http://www.bing.com”;
}
header(“Location: $selection”);
?>
<html>
<head>
<title> Wich Search Engine </title>
</head>
<body>
<div style =”background:#339933″>
<form action = “<?php $_SERVER[PHP_SELF] ?>” method = “POST”>
<font color=”#99ff66″><b>Take me to:</b></font>
<input type = “radio” name = “choice” value = “google”>Google <b>|</b>
<input type = “radio” name = “choice” value = “yahoo”>Yahoo <b>|</b>
<input type = “radio” name = “choice” value = “bing”>Bing<br><br>
<input type = “submit” value = “Take Me”>
</form>
</div
</body>
</html>
|
*******
You can also use a html table instead of using ‘<div></div>’ tags. It will be more easy for you to align its elements.
Advertisement
Like this:
Be the first to like this post.
Posted by Mahesh Arandara on March 1, 2010 at 2:51 pm
wow…this is great work buddy…. keep writing more useful stuff. Good Luck
Posted by Dushi on March 1, 2010 at 3:19 pm
Thanks a lot buddy.. appreciate a lot that you gave time to visit this place. thank you again