HTML forms + variable

Soldato
Joined
12 Dec 2003
Posts
2,588
Hi,
I am trying to make a form that appears on a page as a text box + submit button. I need what ever is typed in the textbox to appear in the url eg:

if I typed 'pen' in the text box it would take me to "www.site2.com/stuff/pen"

what would the code for this be?

cheers
 
on the page

Code:
<form method=post action="change.php" / ><br />
<input name="place" type="text" value="Where" size="15" / ><br />
<input type="submit" name="submit" value="Go" / >
</form>

change.php
PHP:
if ($_POST['submit']) {
$where = $_POST['$place'];
header("http://www.site2.com/stuff/".$where);
}

think that will work but im tired :)

edited
 
Last edited:
Back
Top Bottom