kiss-o-matic Posted June 19, 2011 Share Posted June 19, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/239760-curl-tell-remote-server-javascript-is-enabled/ Share on other sites More sharing options...
kiss-o-matic Posted June 19, 2011 Author Share Posted June 19, 2011 Okay, I'm kind of having an epiphany... the only way the remote server can detect if it's enabled or not is to actually have the browser/script execute some type of javascript and send a value back, right? Quote Link to comment https://forums.phpfreaks.com/topic/239760-curl-tell-remote-server-javascript-is-enabled/#findComment-1231637 Share on other sites More sharing options...
mikesta707 Posted June 19, 2011 Share Posted June 19, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/239760-curl-tell-remote-server-javascript-is-enabled/#findComment-1231646 Share on other sites More sharing options...
kiss-o-matic Posted June 19, 2011 Author Share Posted June 19, 2011 I have found part of it. There's a <noscript> tag which is setting a hidden input tag. I've ignored it but haven't quite figured out the rest. On the trail though. Quote Link to comment https://forums.phpfreaks.com/topic/239760-curl-tell-remote-server-javascript-is-enabled/#findComment-1231689 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.