Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 656

i got data from a form using the post method and i want to pass that value to another page using but it is not working. Redirect a POST to a GET

$
0
0

please help me correct this code

$salt = 'XyZzy12*_';$stored_hash = '1a52e17fa899cf40fb04cfc42e6352f1';//$stored_hash = 'a8609e8d62c043243c4e201cbb342862';  // Pw is meow123$salted = md5($salt);$failure = false;  // If we have no POST data// Check to see if we have some POST data, if we do process itif ( isset($_POST['who']) && isset($_POST['pass']) ) {    if ( strlen($_POST['who']) < 1 || strlen($_POST['pass']) < 1 ) {        $failure = "User name and password are required";    } else {        $check = hash('md5', $salted.$_POST['pass']);        //print "$check";        if ( $check == $stored_hash ) {            // Redirect the browser to game.php            header("Location: game.php?name=".urlencode($_POST['who']) );            return ;        } else {            $failure = "Incorrect password";        }    }}

The first stored_hash is not working and when i put the second an error occur saying expected a POST to redirect to a GET but received POST

I tried passing the just the page game.php but it is still not working and when i look the code from my research it seems currect


Viewing all articles
Browse latest Browse all 656

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>