开发者

how to submit a form from a php script [duplicate]

开发者 https://www.devze.com 2023-03-21 15:06 出处:网络
This question already has answers here: 开发者_如何学编程 Closed 11 years ago. Possible Duplicate:
This question already has answers here: 开发者_如何学编程 Closed 11 years ago.

Possible Duplicate:

Auto Submitting a form (cURL)

I have a form which submits to a php script. In this form I need to collect all the $_POST data and then post this on to another form (the reason for this isn't really relevant but there is a good reason).

My question is once I've collected all the data from the initial form submit, sanitised it and assigned it all to variables how do i then package it all up to send to the next form? The second form is expecting a $_POST with hidden fields with particular name attributes....so how do i do this? do I build the actual html and submit that somehow to the second form or do I buld some sort of array and send that?

hope this makes sense. Kind of hard to put in to words.


  1. You can generate form and submit onLoad by Javascript
  2. You can use curl to send POST query (from your server but not from client)


The better way woudl be to store the sanitized variables in the session.

Collect all the information you need from all the forms you need.

Then after you have all the data needed, then finally update the DB (or Somethign else)


if I understood you well when you open the form you tell it wich acction will it perform .when you click submit it will take you to the other form.in the other form you can access the values of the input fields from the previous form with $_POST['name_of_the_input_field'].i hope this will help you :D

0

精彩评论

暂无评论...
验证码 换一张
取 消