I suppose this has more to do with cURL than it does PHP, but I couldn't find a forum for cURL, so here goes...
I'm attempting to create a script that will POST a form to a remote server through cURL, essentially mimicing the action of a user filling out the form through their browser. I setup a test web server and am able to post forms to it fine (read data from a text file [one line per customer, pipe-separated fields], break each line into an array, use the array elements as the POST data), but now I am at the point where I switch away from my test server to the actual server.
The actual server uses a login form with what I'm assuming to be session cookies. The first time you visit the page, you redirected through a login form. If you attempt to POST the form without going through the login form, you get a message saying you're not logged in. Since this isn't an IE dialog asking for your username and password, I can't send the username and password along in the headers.
The reason I believe this is a session cookie is because I don't see a cookie file appear on my system from this domain, and as soon as I close the browser and go back to the server, I'm forced to log in again.
What I need to do is find out: first, if this is indeed a session cookie, then how to read the data, and finally how to send that uid/pw combo along with the mimiced form so the remote server believes I actually did go through the login form.
I do have a valid username/password combo for this server, so I'm not trying to hack into anything. I just hope to automate a process of filling out a standard HTTP form that is normally submitted hundreds of times per day. It would be nice if I can just dump a text file to the client script which parses and submits everything nearly instantly, versus spending upwards of 2 hours a day doing it all by hand.
Any help would be greatly appreciated!
/<
I'm attempting to create a script that will POST a form to a remote server through cURL, essentially mimicing the action of a user filling out the form through their browser. I setup a test web server and am able to post forms to it fine (read data from a text file [one line per customer, pipe-separated fields], break each line into an array, use the array elements as the POST data), but now I am at the point where I switch away from my test server to the actual server.
The actual server uses a login form with what I'm assuming to be session cookies. The first time you visit the page, you redirected through a login form. If you attempt to POST the form without going through the login form, you get a message saying you're not logged in. Since this isn't an IE dialog asking for your username and password, I can't send the username and password along in the headers.
The reason I believe this is a session cookie is because I don't see a cookie file appear on my system from this domain, and as soon as I close the browser and go back to the server, I'm forced to log in again.
What I need to do is find out: first, if this is indeed a session cookie, then how to read the data, and finally how to send that uid/pw combo along with the mimiced form so the remote server believes I actually did go through the login form.
I do have a valid username/password combo for this server, so I'm not trying to hack into anything. I just hope to automate a process of filling out a standard HTTP form that is normally submitted hundreds of times per day. It would be nice if I can just dump a text file to the client script which parses and submits everything nearly instantly, versus spending upwards of 2 hours a day doing it all by hand.
Any help would be greatly appreciated!
/<