Currently I put a constant on my webpage using PHP which I then send, with Ajax, to my POST function. However, this leaves it susceptible to hacking (the user could change the variable with Firebug), so is there a way to store the variable in the PHP of the page and then access it later on, in the POST method (or is the GET variable of the page still available in the POST function, since that's where I get the variable from)?
2条回答 默认 最新
- duanpie4763 2014-09-29 12:22关注
I think what you have wanted is to store the post value to use it later.
Here you would need to use
$_SESSION
You can do it like
session_start();
// Save variables into session
$_SESSION['thevalue'] = $_POST['value'];
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报