generating page to redirect help
Author |
Message |
r0ssar00
|
Posted: Tue Apr 26, 2005 6:16 pm Post subject: generating page to redirect help |
|
|
my os is win32
im using php5
i need to have php generate a page that will redirect automatically to a url and port passed to the script through a html form
the code for the html is
code: |
<html>
<body>
Pease enter the URL and port number to access your Azureus web interface.
<form action="port_choose.php" method="post">
URL: <input type="text" name="url_way" /><br />
Port Number: <SELECT name="port_way"><OPTION value="80">80</OPTION><OPTION value="6881">6881</OPTION><OPTION value="6883">6883</OPTION><OPTION value="76">76</OPTION></SELECT><br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
?>
|
and the code for the php script is
code: |
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://<?printf("%s:%s",$_POST['url_way'],$_POST['port_way'])?>>
</head>
<body>
Redirecting to your interface... <br>
If you are not redirected, click <a href=http://<?printf("%s:%s",$_POST['url_way'],$_POST['port_way'])?>>here.</a>
</body>
</html>
|
the output to the browser is
(you literally read this on the page, this is not the html that is generated)
code: |
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://mywebpage.com:6881> Redirecting to your interface...
If you are not redirected, click here.
?>
|
it needs to have the refresh in the header and to actually refresh, it is not
i hope anyone can help me
i already tried
code: |
<?
header("Location: ".$_POST['url_way'].":".$_POST['port_way']);
?>
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
rdrake
|
Posted: Tue Apr 26, 2005 7:01 pm Post subject: (No subject) |
|
|
Try using javascript:
code: |
<body onload="window.location='http://<site>:<port>';"
|
It should automatically direct the user to the specified location and port. |
|
|
|
|
|
|
|