Jump to content

How can I automatically fillout a two page form with php?


abefroman99

Recommended Posts

How can I automatically fillout a two page form with php?

 

I want to fill out step 1 of the form, submit it, then on page 2 step 2 of the form, grap that page and the hidden fields which were generated based on the data from step one, check a couple check boxes, and submit step 2 of the form.

 

Got any tips on what functions I could use or where to start?

 

TIA!

Curl has a couple problems with it and isn't always installed. Thomas Harding makes a better version that is written in PHP, but you have to get it off PHP Classes.org.

 

http://www.phpclasses.org/browse/file/12461.html

 

Sending the post data is easy, but parsing the form will be hard if your not good at regex.

use functions to generate the form and another function to proccess it

<?php
   function form_1(){
  ?>
<form action=<?php echo $_server[php_self]?> method=post>
....
<input type=submit name=submit_1 />
<?php
}
// end function form_1

function proces_1(){
.
.
.
.
}
  function form_2(){
  ?>
<form name=form 2 action= ..... >
..
.
.
<input type=submit name=submit_2 />
<?php
}
// end function form_2

if (isset($_post[submit_1])){
  proces_1();
  form_2();
}else{
form_1();
}

?>

if you got the idea !!

 

  i'm using this sometimes and it works for me

i don't know if it right way or not let others tell you and me  ;D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.