php script to open a location based on the input in a form

I am trying to make a code where a client gets directed to a document which has identical name as the input of the client when the submit button is clicked. Target html file is created manually already.

The scenario is for example, if client enters “12345” in the input and clicks submit, the php script takes the client to a 12345.html document I already created. If client enters a different input, he gets redirected to a 404 page not found.

I have a very small knowledge. I only base on CSS and html.

This is the little code my head could put together.

[php]“header(“Location: .$_POST[‘inputted_string_without_space’].+.html”);”;[/php]

Any help will be highly appreciated

I am going to ask what the goal for this is. It looks like this is harder than it should be, honestly. If you are just redirecting to another page, using a select box is far easier than typing a number in a text field. But, I really don’t think that is the end goal.

Problem is solved. I found a solution on stackoverflows… It was solved with a simple code. A modification of the input form that helps rebuild URL based on input data.

[code]


[/code]

Thanks for your reply

Still a poor structure, but your system.

Sponsor our Newsletter | Privacy Policy | Terms of Service