Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing POST data from one web page to another with PHP

Tags:

People also ask

How do I send data from one page to another in HTML?

The method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute). The form-data can be sent as URL variables (with method="get" ) or as HTTP post transaction (with method="post" ). Notes on GET: Appends form-data into the URL in name/value pairs.

How can I pass ID from one page to another in PHP?

$id = $_GET["myid"]; If you look at above code you will get idea how we are accessing the first page variable to second page through $_GET variable method to share the information from one page to another page and storing them in $id variable that we have created. So below is the complete code of display. php page.


Searching did not find a similar question, so: How can POST data used by PHP to generate one page be passed from that page to another PHP generated page? I have:

  • A form on page 1 which sends data to a PHP script via POST.
  • Page 2 is generated by that script and shows one or more graphs generated by an external program using the entries on page 1 and the back end database. This page also has another form with options to re-generate the graphs with new options (e.g. zoom in on or truncate the graph(s)).
  • If requested, page 3 will be generated with the same PHP script using POST data glued together from pages 1 and 2. Except for the graphs, its basic appearance will be the same as page 2.
  • Pages 4, 5, 6 ... should be generated in the same manner as page 3.

So, how can I put the POST data used to generate page 2 into the POST data for page 3?

EDIT: Due to organizational policy, cookies can't be used (so sessions are not feasible). GET is undesirable because we don't want the input to show in the URL.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!