Skip to content
Advertisement

Input from form to url?

So the goal is to take the input from a form append it to the end of the URL and then return the HTML from that page. I am not entirely sure how to take the forms value (in this case $2) and attach it to the URL.

JavaScript

Advertisement

Answer

On submit any input from a form with method=”POST” will be stored in the $_POST global. You can access it from there and append it to your URL string.

JavaScript

Using the IF statement to check if it is set will prevent it from loading the URL with no variable.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement