View Full Version : Simple go-to link

06-23-2006, 08:18 AM
The principle of this is as follows:
- user imputs his url into a textfield (or textarea) and presses button
- my url is added in front of his :http://myurl.com?http://hisurl.com
- he goes to his imput page (without opening in another page)

Could somebody guide me into doing this?

06-23-2006, 08:45 AM
if(isset($_POST['submit']) && $_POST['submit'] == 'Go')
$yoursite = 'http://www.yoursite.com/?';
$url = $_POST['url'];
header('Location: '.$yoursite.$url.'');
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<form action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
<input type="text" name="url" id="url" /><input type="submit" name="submit" value="Go" />

06-23-2006, 08:54 AM
thanks so much, you're the man :)

06-23-2006, 09:02 AM
nvm.. figured it out