form action parameter not working

13,734

Solution 1

you have to use this code.

    <a href="index.php?page=test"> Test </a>
<br><br>
<form action="index.php" method="get">
    <input type="text" placeholder="enter text"> </input>
    <input type="hidden" name="page" value="test">
    <button type="submit">Send</button>
</form>

Solution 2

You are submitting a GET form. The data in the form will be expressed as a query string and replace the one in the URL in the action.

Move the data from the query string into hidden inputs inside the form.

Share:
13,734

Related videos on Youtube

Philipp
Author by

Philipp

Updated on June 04, 2022

Comments