Jump to content

cURL Get Results


sug15

Recommended Posts

Hey, I need to get the results of a page with curl without submitting the page, because every time the page submits with curl or refreshes with a borwser, a value that I need to submit changes. I was wondering if there was any way to load the page with curl and just get the results, then submit a form later on that submits some data parsed for the page loaded.

 

Basically load data from the page, do something, then submit a form but only using curl_exec once.

Link to comment
https://forums.phpfreaks.com/topic/146213-curl-get-results/
Share on other sites

In other words you're trying to circumvent some check that's in place to ensure that a user is actually making the request and not an automated script?

 

I don't really care if that's what you're trying to do, but you might as well be honest about it.

Link to comment
https://forums.phpfreaks.com/topic/146213-curl-get-results/#findComment-767875
Share on other sites

In other words you're trying to circumvent some check that's in place to ensure that a user is actually making the request and not an automated script?

 

I don't really care if that's what you're trying to do, but you might as well be honest about it.

 

Basically, yes. Except I'm not going to use it for spamming.

Link to comment
https://forums.phpfreaks.com/topic/146213-curl-get-results/#findComment-767889
Share on other sites

They're not particularly difficult to get around - which is why i wouldn't rely on them. To be able to work round it, you need to understand how it works. When the form is loaded, some sort of pseudorandom number/string is stored in a hidden field. It is also stored in a session. When the form is submitted, the values in the hidden field and the session are compared. If they're equal, it means the user loaded the form prior to submitting it. If they're not, it means someone posted the form directly, without visiting the form page first.

 

So, in order to have an automated request do this, it must be able to accept a cookie so that the session ID can be created on the first request and be the same on the second. Happily, cURL provides cookie functionality. So that's what you need to look up.

Link to comment
https://forums.phpfreaks.com/topic/146213-curl-get-results/#findComment-767892
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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