Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 generating page to redirect help
Index -> Programming, PHP -> PHP Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
r0ssar00




PostPosted: 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
Sponsor
sponsor
rdrake




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, PHP -> PHP Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: