adding url from a form

liunx

Guest
is there any way to have a person type in something into a form then have that respone take the person to a specific page? if they typed 843 it would take them to something.com/843.htm somthing like that<!--content--><script type="text/javascript"><br />
function redirectIt( page ) {<br />
document.location = "http://something.com/"+ page +".html";<br />
}<br />
</script><br />
<input type="text" id="page" /><input type="button" value="go" onclick="redirectIt( document.getElementById('page').value )" /><br />
<br />
<br />
that should work, although it is untested<!--content-->Newguy<br />
<br />
If youre going to use the above code make sure you change the .html to .htm as it looks like that is your naming convention.<br />
<br />
You could also use PHP or ASP as some people turn off Javascript.<!--content-->how would you do that in PHP?<!--content-->uhh easily...<br />
have that basic form, then on the php page that interprets it just get the variable and send a header with the url like<br />
<br />
$url = $_POST['url'];<br />
header( "Location: <!-- m --><a class="postlink" href="http://www.somewhere.com/$url.html">http://www.somewhere.com/$url.html</a><!-- m -->" );<!--content-->:doh: i've been drinking too many dr. peppers.<!--content-->
 
Back
Top