Reputation: 657
Is it possible to read the value right on load? I suspect not.
<!DOCTYPE html>
<html>
<head>
<title>Some test</title>
</head>
<body>
<form method="POST">
<input type="hidden" name="token" value="<?php echo sha1("text")?>" >
</form>
<?php
echo $_POST['token'];
?>
</body>
</html>
Let's say I want to send some values generated by php like so:
<a href="url + page?options=1&token=sasadasdasda878asd7as8d7a">
Is there an option to get the token without passing it by URL (using get)?
Upvotes: 0
Views: 7756
Reputation: 943516
$_POST
will be populated with the data sent by the browser.
If you have a form in the page, then the data submitted by the form will only be sent by the browser when the browser submits the form, it won't be submitted when the page is initially loaded since:
Upvotes: 2