It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

opening url

Moderator: Malcolm

opening url

Postby arpita on Wed Jun 08, 2005 7:03 am

hello everybody,

i want to take a text box inwhich we can set url and after submitting that form open that url in new window.

thank you
arpita
 
Posts: 6
Joined: Wed Jun 08, 2005 6:49 am

Postby webmaster on Wed Jun 08, 2005 12:11 pm

Hi and welcome to DEVPPL.

Im not sure if this is the best way, but this is how I would do it.

index.php:
Code: Select all
<form action="redirect.php" method="post">
URL: <input type="text" name="url"><br />
<input type="submit" name="submit" value="GO TO URL">
</form>


redirect.php:
Code: Select all
<?php
$to = $_POST['url'];
header("Location: $to");
exit;
?>
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden


Who is online

Users browsing this forum: No registered users and 0 guests