Jump to content

CURL - tell remote server javascript is enabled?


kiss-o-matic

Recommended Posts

Howdy freaks,

I've got a very simple issue.  Some code has been running for a couple of years now relatively hassle free.  The code uses a CURL wrapper to do the following:

 

Slurp page->Login->Do something->Log out

 

The login part is borked now, and I have traced it to a very simple, but nasty thing the remote side is doing: they check if Javascript is enabled in the browser (in this case, a PHP script) or not.  If it's not, they are employing an anti-phishing human-confirmation thing.  This is bad.  I see nothing in the CURL documentation to set this, but I would assume it's possible somehow.

 

Thanks

Link to comment
Share on other sites

After a quick google search, I came up with the following

No.

 

This is simple like this - a page tests, if you have JavaScript enabled, by using the JavaScript to execute a command, that will remove things like "you don't have JavaScript enabled".

 

Therefore, if you do NOT have JS enabled, the error won't go away.

 

Optionally (and even more likely) the JavaScript will REDIRECT your browser to the actual page, if JS is not enabled - again, you will stay at the first page, which says you don't have JS enabled...

 

PHP curl is NOT a full browser. It is just a library that is used for communicating with servers, using HTTP, FTP, et cetera. It does not do neither rendering nor parsing.

 

For this functionality, you would need a JavaScript engine... to my knowledge there is not one in PHP that is fully functional.

 

And I am inclined to believe what this poster is saying is true. Sorry, but I don't think their is a way to "spoof" javascript being enabled with curl

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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