Reputation: 560
It seems to be a simple but still it is difficult for me to achieve. Let`s make a small example to clarify the situation: There are two files: Form.PHP and Action.PHP
Form.PHP has one Input field with name = "ID" and button SUBMIT
Action.PHP has a script of inserting data in MySQL and in the end next line:
header("location:Form.PHP");
So after the submitting the form, I come back to Form.PHP... This is easy...
Now, I want to achieve - after the submitting the form redirection to Form.PHP?ID=$_POST['ID']
So please help me to modify header("location:Form.PHP"); to redirect to ?ID=$_POST['ID']
Upvotes: 0
Views: 156
Reputation: 618
It's usual URL writing like we normally do. Your code would be
header("location:form.php?id=$id");
make sure you initialize $id = $_POS['id'];
Upvotes: 1