abefroman99 Posted December 28, 2007 Share Posted December 28, 2007 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! Link to comment https://forums.phpfreaks.com/topic/83446-how-can-i-automatically-fillout-a-two-page-form-with-php/ Share on other sites More sharing options...
trq Posted December 28, 2007 Share Posted December 28, 2007 Take a look at the curl extension. Link to comment https://forums.phpfreaks.com/topic/83446-how-can-i-automatically-fillout-a-two-page-form-with-php/#findComment-424523 Share on other sites More sharing options...
tibberous Posted December 28, 2007 Share Posted December 28, 2007 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. Link to comment https://forums.phpfreaks.com/topic/83446-how-can-i-automatically-fillout-a-two-page-form-with-php/#findComment-424585 Share on other sites More sharing options...
janim Posted December 28, 2007 Share Posted December 28, 2007 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 Link to comment https://forums.phpfreaks.com/topic/83446-how-can-i-automatically-fillout-a-two-page-form-with-php/#findComment-424626 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.