I didn't use PHP much. Special to this forum to ask.
Now the problem is that the user entered the user name and password, login, if the password simple point, can be passed. But if the password is ab@;&1 this, then found that the server gets the password value is clipped, into ab@; But immediately after the code, the following part is also so operation, incredibly can, really did not find two differences, seeking doubts.
Client part of PHP
function Getfirstu8accid () {var susername = document.getElementById ("user_name"). Value.tolowercase (); var spassword = document.getElementById ("password"). Value;susername = Escape (sUserName), if (susername== "") {return ("");} var surl = '/server/a.php?t= ' +escape (Date ()) + ' &a= ' +susername+ ' &b= ' +spassword; var xml = Createxmlhttp (); Xml.open ("GET", Surl,false); Xml.send (); var sloginuser = Xml.responsetext; To deal with ....} The specific call is shown in the following code//Here Call Getfirstu8accid () failed, the specific error is that the server PHP does not get the full password content. Accid = Getfirstu8accid (); Try{var guid = obj. Getclientguid ();} catch (E) {return "error:failed to call Getclientguid,error message:" + e.message;} var surl = '/server/b.php?t= ' +escape (Date ()) + ' &a= ' +user+ ' &b= ' +password+ ' &c= ' +sdomain;var XML = Createxmlhttp (); Xml.open ("GET", Surl,false); Xml.send (null); Here can return normally, because the code in b.php can normally get the password content return xml.responsetext; [/color]a.php b.php in theThe code is probably the following, in fact, basically the same, just a number of parameters in B, more than an analytic. [code=php]
Give me the feeling, is the first time after the failure, then do the second time, just with more parameters, on the success. Although the server, a, B, two PHP files, but actually no difference.
Reply to discussion (solution)
The & character appears as a field delimiter in the URL parameter string, and if you have that character in your value, you need to do URL encoding processing (%26)
Moderator really fast ha, but the second time when the submission, it seems that no processing ah.
In addition, URL encoding processing, there is no common code it? I am in English and Chinese three languages, will have influence? PHP is not familiar. I just didn't use it for a long time, do you have any relevant information or small examples?
JS don't have encodeURI, encodeURIComponent method?
The problem is solved. In the first place, there is no escape operation for the password, and the receiving office has unescape processing. And the second place is paired. Thank you for the version prompt.
var surl = '/server/a.php?t= ' +escape (Date ()) + ' &a= ' +susername+ ' &b= ' +spassword;
Change?
var surl = '/server/a.php?t= ' +escape (Date ()) + ' &a= ' +encodeuricomponent (susername) + ' &b= ' +encodeuricomponent (Spassword);