Well, it's clearer, but wow, this is some messy stuff. Ok, so there's a hidden field named 'pusr' that starts out with the value "". Then some pretty sketchy-looking javascript takes the URL of the page, breaks it up by splitting it on &, then breaks up each part of that by splitting on =, and for each of those, assigns the second half as the value of the hidden field named 'pusr'. (But see my last paragraph for why it doesn't actually do that either.)
So if the URL is something like http://example.com/index.pl?type=search&user=john, then first it'll set 'search' as the value of the 'pusr' field, and then it'll assign 'john' as the value. So what gets assigned will be the value of the last pair in the URL.
Since we don't know the URL, we can't really diagnose any further here. My next step (short of scrapping all this and starting over) would be to put an alert after the document.getElementByID line, so you can see what's being assigned. Something like alert(acc_usr);. That'll show you how many values are being extracted from the URL, and which is the last one found.
Oh, and there's another problem: getElementById is looking for an element with id='pusr', but there isn't one, so that assignment does nothing (except maybe throw a javascript exception). There's a difference between name='pusr' and id='pusr', so you may want your hidden field to have both.
In reply to Re^3: y username is empty
by aaron_baugher
in thread y username is empty
by sasidhardv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |