Forum Moderators: coopster
?php
if($location!=null)
{
header(' Location: $location' );
exit();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>redirect</title></head>
<body>
choose a site to visit:
<form action="<?php echo ($PHP_SELF);?>" method ="post">
<select name ="loc"><?php $location=$_POST["loc"];?>
<option value="http://www.google.com">Google</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.gmail.com">Gmail</option></select>
<input type="submit" name="submit" value="Go">
</form>
</body>
</html>
i select a site and then submit the form but nothing happens. what may be the problem?
Thanks in advance
<?php
if($_POST['loc']!= null)
{
header('Location: $_post["loc"]');
exit();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>redirect</title></head>
<body>
choose a site to visit:
<form action="<?php echo ($PHP_SELF);?>" method ="post">
<select name ="loc"><?php $location=$_POST["loc"];?>
<option value="http://www.google.com">Google</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.gmail.com">Gmail</option></select>
<input type="submit" name="submit" value="Go"><? php echo("$location");?>
</form>
</body>
</html>
Firstly it opens a page with a form for printing.
obviously as it is a printed form, it has no links etc
so i have opened it in a new window with the window.open javascript function.
Next it opens the summary page in the original window using window.location
however - How could i do this in php only?
i can get it to change page using the php header command
but what about the other popup page?