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 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. Link to comment https://forums.phpfreaks.com/topic/8771-help-me/#findComment-32219 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.