Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Authentication with WWW::Mechanize

by CountZero (Bishop)
on Sep 19, 2005 at 21:13 UTC ( [id://493308]=note: print w/replies, xml ) Need Help??


in reply to Authentication with WWW::Mechanize

You may have noticed that the log-in page has some JavaScript running:
<SCRIPT LANGUAGE="JavaScript"> <!-- if (window!= top) top.location.href=location.href; var form; function init(){ form = document.li; if (form.USERID.value == "") form.USERID.focus(); } var scount = 0; function submitForm(){ scount++; if (scount==1) form.submit(); else return false; } // --> </SCRIPT>
and that clicking the submit button actually runs this code rather than do the usual CGI-submit. I'm not into JavaScript, but perhaps it can explain WWW::Mechanize not working.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Replies are listed 'Best First'.
Re^2: Authentication with WWW::Mechanize
by shenme (Priest) on Sep 20, 2005 at 04:55 UTC
    All that the code in submitForm() is trying to do is prevent double-submits. It does the form.submit() only once, the first time called. (Returning false from an onsubmit handler says don't do a submit - they coulda structured this as just returning true or false, I think)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://493308]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found