PHP: Form: Submit data via POST and GET at the same time
Question by Guest | 2012-06-16 at 21:30
I just wonder, whether it is possible in principle to transfer data from an HTML form with POST and send other variables with GET in the URL (so that it can be seen in the browser) at the same time.
The background: The POST variables should be further processed in a PHP script, while the GET variables are used to display the page. On my HTML page, I have multiple forms, so that it depends on the GET variable, to which page is forwarded.
Related Topics
jQuery: Submit complete form and receive content with Ajax
Tutorial | 0 Comments
Send HTML5 Canvas as Image to Server
Tutorial | 0 Comments
Units: SI Prefixes for Powers of Ten
Info | 0 Comments
JavaScript: Catch Submit of Form
Tutorial | 0 Comments
HTML Form: Redirection depending on Radiobutton or Checkbox State
Tutorial | 0 Comments
How to resize Image before Upload in Browser
Tutorial | 13 Comments
XLS and XLSX: Maximum Number of Columns and Rows
Info | 2 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Just write the variables to be transmitted via GET into "action" in your form. The rest of the form remains unchanged.
Here's an example:
The PHP Script can look something like this:
With this, you have transferred two variables with POST and one variable with GET.
2012-06-18 at 13:35
You are correct. It works fine. I've been using it successfully with an ajax search form, and dynamic codes sent over to the receiving php script.
2020-02-11 at 00:15