13
Jan
Posted 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.
Comments