lundi 28 mars 2016

weird nginx on javascript form.submit

I have a form

<form method="POST" class="m-t-md" action="login.php" name="login_form">
                                    <div class="form-group">
                                        <input type="email" name="email" class="form-control" placeholder="Email / Username" required>
                                    </div>
                                    <div class="form-group">
                                        <input type="password" name="password" id="password" class="form-control" placeholder="Password" required>
                                    </div>
                                    <input type="button" value="Login" class="btn btn-success btn-block" onclick="formhash(this.form, this.form.password);" />
                                    <!-- <a href="#" class="display-block text-center m-t-md text-sm">Forgot Password?</a> -->


                                </form>

and the formhash function :

function formhash(form, password) {
    // Create a new element input, this will be our hashed password field. 
    var p = document.createElement("input");

    // Add the new element to our form. 
    form.appendChild(p);
    p.name = "p";
    p.type = "hidden";
    p.value = hex_sha512(password.value);

    // Make sure the plaintext password doesn't get sent. 
    password.value = "";

    // Finally submit the form. 
    form.submit();
}

when i click the button it do redirect me to http://link/login.php but it gives me 500 error and if i just refrest that page it's loading (but with no post data)

What is this weird problem with nginx on centos 7 ? I've tested in XAMPP and worsk just fine ... :(




Aucun commentaire:

Enregistrer un commentaire