Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.