[PHP] Populating Other People's Forms

2002-09-10 Thread Mike At Spy


I would like to write a script that would populate someone else's form on
the net and get the results.

Off hand, I imagine I would use fopen() to open up the web page and pass
some variables to it.  The problem I have is that the form I want to
populate is a multi-step CGI.  Is this possible?  How do I continue to pass
variables to a second or third step, sending variables passed on what the
form says to do next (which is predictable)?

This is considering I do not have the cooperation of the web site I am
trying to fill out the form for step by step, and I would like to write this
so it is done in a behind-the-scenes, automated way.

For example:  A customer registered with me could ask for a product.  My
'agent' would go to the site where the product is sold, login, submit all of
the appropriate information for purchase and shipment, and then come back
with (hopefully) a success message (along with any pertinent information
from the purchase).

Anyone have any ideas, suggestions, or can point me in the right direction?

Thanks,

-Mike



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Populating Other People's Forms

2002-09-10 Thread Chris Shiflett

It sounds like you need to look into using cURL. It helps with automated 
posting.

Now, you need to first determine whether the forms in question use a 
method of get or post before deciding how to proceed. If they use 
get, you can simply use a series of fopen() calls with the appropriate 
parameters on the URL. If they use post, you should look at cURL to see 
if it will handle your needs.

Happy hacking.

Chris

Mike At Spy wrote:

I would like to write a script that would populate someone else's form on
the net and get the results.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php