Forum Moderators: coopster

Message Too Old, No Replies

create dynamic link based on text input field

         

pstar99

8:44 pm on Jun 16, 2009 (gmt 0)

10+ Year Member



Hi,

I'm trying to make a text input field where visitors can enter a three digit number and then hit go or submit.

Based on the three digit number they would be send to a new page.

For example if they enter 123 and hit submit it would send them to http://www.example.com/123.html

Could anybody please help me get this up and running?
Thank you

[edited by: coopster at 11:31 am (utc) on June 17, 2009]
[edit reason] please use example.com, thanks! [/edit]

Robeysan

10:19 pm on Jun 16, 2009 (gmt 0)

10+ Year Member



It's possible that you could just concatenate the base URL with the user input and an extension.

$url = "www.domain.com";
$usrInput = $_POST['$usrInput'];
$ext = ".html";
$sendUserTo = $url.$usrInput.$ext;
//then redirect them with header
header('Location: '.$sendUserTo);