is there a way for me to send a $_POST value to another page without using FORM or SESSION method? because the form method is already being use inside the page itself but i need to send 1 variable to the other page for confirmation.
a simple php or javascript will be great!
this is the value
<input name="sig" id="sig" type="text" value="<?php echo $_POST["sig"]; ?>" />
code that is supposed to catch the code on the next page
<?php
$pass = $_POST['password'];
$password = "service2012"; // Modify Password to suit for access, Max 10 Char.
if ( $pass != $password) {
header("Location: https://www.login.html");
}
?>
If you are passing a password to the other page, then it does not make sense using
GETvalues. All the solutions till now have beenGETvalues, which anyone can modify. It is usually not safe and creates an XSS vector.I want to understand why do you want to pass the password to the next page, cause usually, you design your application such that the user enters the password once, and you create a SESSION variable.
You then check this SESSION on each page that requires the user to be logged in. You can use any popular programming language to understand how to create SESSIONS. For PHP :
You should ideally, create a session and then pass this session variable in place of passing
POSTdata.Let me know in case you need further clarification on this.