Jump to content

[SOLVED] enter url then click to open in new window


emma225

Recommended Posts

This should be so simple but is causing me a lot of grief. I need a web form with a text box where user woould enter url, then click go button, and url would open in new window. This was as far as I got

 

<?PHP

$urlToGoTo = @$_POST["url"];

if(!empty($urlToGoTo)){

header($urlToGoTo);

}

?>

 

Any advice would be appreciated

Cheers ;) ;)

You should just do this in Javascript.

 

<form name="redirect" onsubmit="window.location = document.getElementById('redirect_link').value; return false;" action="" method="">

<input id="redirect_link" type="text" />
<input type="submit" value="Go!" />
</form>

Thanks a million for you suggestions. I'm nearly there I think. Still having a problem though, when I click 'go' it takes me to the place where the file is saved

 

C:\wamp\www\www.google.com

or the same on the server

 

Any ideas??

Cheers ;)

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.