problems with some characters in $_POST['password'];
<p>I have problems with some characters in password input form</p>

<p><code>" = \"</code></p>

<p><code>' = \'</code></p>

<p><code>\ = \\</code></p>

<p><code>&amp; = empty</code></p>

<p><code>+ = empty</code></p>

<p>so if user types 
<code>n1N'11</code></p>

<p>in output he will get
<code>n1N\\\'11</code></p>

<p>1) what I am doing wrong? In ajax-php password validation file I use simply <code>$password=$_POST['password'];</code> and get such result. In file that records data in mysql, I use <code>$password = $mysqli-&gt;real_escape_string($_POST['password']);</code>. But these problems are already at password validation...</p>

<p>2) How to change? I can change \" back to ", but can not change empty to &amp; or +, because do not know what the visitor typed. Or simply not to allow to enter &amp; and +</p>

<p>3) are there some more characters like mentioned?</p>

<p>I am new to programming. Possibly the questions are stupid.</p>

<p>sorry, here is ajax code. but seems i have solved my problem. Need to use encodeURIComponent before pass     </p>

<pre><code>&lt;script type="text/javascript"&gt;
// Pasword validation
//pass data without page refresh
function ValidatePassword(){
// Create our XMLHttpRequest object
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
var hr = new XMLHttpRequest();
}
else
{// code for IE6, IE5
var hr = new ActiveXObject("Microsoft.XMLHTTP");
}
// Create some variables we need to send to our PHP file
var url = "_validator.php";
var pass = document.getElementById("password").value;

var vars_pass = "&amp;password="+encodeURIComponent(pass);

hr.open("POST", url, true);
// Set content type header information for sending url encoded variables in the request
hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// Access the onreadystatechange event for the XMLHttpRequest object
hr.onreadystatechange = function() {
if(hr.readyState == 4 &amp;&amp; hr.status == 200) {
var return_data = hr.responseText;
document.getElementById("CheckPassword").innerHTML = return_data;

}
}
// Send the data to PHP now... and wait for response to update the status div
hr.send(vars_pass); // Actually execute the request
document.getElementById("CheckPassword").innerHTML = "processing...";
}
&lt;/script&gt;
</code></pre>
