I have executed a php script through GET request
ex:
http://localhost/example.php?id=9&name=exammple
Now the example.php has a form field
<form method="post" action="example.php">
---form fields used to post data on server---
</form>
Now on submitting the form, it throws up an error saying undefined indexes.
How do I submit a form in a page which was accessed using GET request? I am a PHP beginner.
Use
<form method="post" action="">Then it will post the data to the same page (with the GET parameters) and you can get them using $_GET and the parameters from the form using $_POST or all with $_REQUEST.