AdRock Posted March 19, 2008 Share Posted March 19, 2008 I have a form with a select box <select name="seats" class="form" style="width:75px"> <option value="any" selected>Any</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> and this is the $_POST $seats = $_POST['seats']; when i $_REQUEST on the next page and echo out the result, i always get 1.....why is this? Link to comment https://forums.phpfreaks.com/topic/97008-post-sending-the-wrong-value/ Share on other sites More sharing options...
teng84 Posted March 20, 2008 Share Posted March 20, 2008 why do you need to use request? if you have post and request try to print them both to see whats the error echo '<pre>'; print_r($_REQUEST); print_r($_POST); echo '</pre>'; see the diff on your two var Link to comment https://forums.phpfreaks.com/topic/97008-post-sending-the-wrong-value/#findComment-496425 Share on other sites More sharing options...
PFMaBiSmAd Posted March 20, 2008 Share Posted March 20, 2008 $_REQUEST should never be used. It combines get/post/cookie so it is likely that you are using one of the other variables with a same name and the last value is replacing any other value. Link to comment https://forums.phpfreaks.com/topic/97008-post-sending-the-wrong-value/#findComment-496427 Share on other sites More sharing options...
AdRock Posted March 20, 2008 Author Share Posted March 20, 2008 Sorted it Link to comment https://forums.phpfreaks.com/topic/97008-post-sending-the-wrong-value/#findComment-496428 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.