tranphuongit Posted April 30, 2006 Share Posted April 30, 2006 I have file [b]exp.html.php[/b]:<form name="question" method="post"><input type="hidden" name="content" value="10"></form><?php $a=document.question.content.value;?>I want $a=10, how? thank Quote Link to comment https://forums.phpfreaks.com/topic/8771-help-me/ Share on other sites More sharing options...
toplay Posted April 30, 2006 Share Posted April 30, 2006 Simple as:$a = (int) $_POST['content'];or this way, can determine if form post was a get or post:$a = (int) ('GET' == strtoupper($_SERVER['REQUEST_METHOD'])) ? $_GET['content'] : $_POST['content'];Assumes you want it to be an integer value. Quote Link to comment https://forums.phpfreaks.com/topic/8771-help-me/#findComment-32219 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.