Forum Moderators: coopster

Message Too Old, No Replies

building a php robot to fill forms

can it be done?

         

Hugene

7:03 pm on Mar 19, 2005 (gmt 0)

10+ Year Member



I sus php/mysql to fuel my site, so I am used to processing forms with PHP. I've never built a robot to automatically fill forms on websites though. I did a little search on the net, but it seems php is used only to process forms. So my question is simple, does php has the ability to automatically fill forms? If it can be done, can someone please point me to some online ressources?

thanks

dcrombie

10:23 am on Mar 20, 2005 (gmt 0)



Actually 'filling out' the forms is pretty meaningless - it's the data that's submitted that's important.

Using PHP/curl you can submit the same information via GET or POST, and (if you're tricky) even mimic the 'referer' value so they don't catch on ;)

zivkovicp

8:08 pm on Mar 20, 2005 (gmt 0)

10+ Year Member



If it can be done,<snip>

It can be done... ever heard of guestbook spamming?

it's pretty easy really... do it like this:

Your PHP script uses GET to grab the form submit page, then parse out the following values:

<form ... action="GRAB THIS" method="AND THIS"
<input name="AND THIS" value="AND THIS"

Grab every input's Name/Value pair and then using the METHOD, submit the name/value pairs to the file mentioned in the ACTION field. (YOU supply the values)

Simple. :)
(I hope you got all that)

Hugene

10:25 pm on Mar 20, 2005 (gmt 0)

10+ Year Member



Thanks a lot. I ll take a look at the curl functions. I'll post some questions if I am having trouble. Its just that I want to automate a submition that I do every day, save me the trouble.

Hugene

12:47 am on Mar 21, 2005 (gmt 0)

10+ Year Member



actually, the page I want to access is https, and I am going to have the php script sit on the server hosting my site (not dedicated, it is called virtual hosting I believe). Is that going to be a problem? If I remember well https pages are accesed using cirtificates; can a php code conect to a page like this? I guess I will probably have to have a certificate sitting somewhere on the web server?

zivkovicp

9:37 am on Mar 21, 2005 (gmt 0)

10+ Year Member



PHP can do everything.

take some time to look through the PHP manual. You can download it from:

[php.net...]

if you want the ENGLISH version (html format) here is a direct link:

[php.net...]

Hope that saves you some time.
Pete

brendan3eb

12:48 pm on Mar 22, 2005 (gmt 0)

10+ Year Member



if you want to automate a submition you do daily, just use cron tabs.

Hugene

7:11 pm on Mar 22, 2005 (gmt 0)

10+ Year Member



I guess I will use cron tabs to run the php script at a specific time everyday.

Hugene

9:39 pm on Mar 30, 2005 (gmt 0)

10+ Year Member



I finally got the script to work. PHP will always impress me.

BUT my server doesn't support cron jobs (is that possible btw?, ins't it built in all Linux flaovors?)

Anyways, can I make a php script run automatically on regular inetrvals some other way? Maybe through some kind of command built in php itself?

Thanks in advance

killroy

10:23 pm on Mar 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One easy way is to put the script on the server, but run the cron on your own computer. write a batch file to use telnet.exe or something else to pull the script from the server and therefore executing it.

SN

Hugene

10:57 pm on Mar 30, 2005 (gmt 0)

10+ Year Member



I am running only Win machines at home, can I still do what you sugested?