tony_p Posted May 27, 2013 Share Posted May 27, 2013 I have a drop down form that the user selects to change the number of items shown per page <form id="pagesize" action="<?php $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; ?>" method="get"> <select class="paginate" name="caption" onchange="this.form.submit()"$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; ?> <option caption=4 value=4>4</option> <option caption=5 value=5>5</option> <option caption=10 value=10>10</option> <option caption=25 value=25>25</option> </select> </form> the problem is that whenever someone perform a get request on the page the POST data disappears. Does anyone know any way in which we can solve this. We can post to the page fine, the print_r of post shows this when we head to the page: Array '/Search_form/search_results.php?photograpgher_id=1&photographer=x&image=x&Submit=Search&page=1' its only when we do a get request on the page we have a problem as the post data does not follow through with the get request we only get the this array '/Search_form/search_results.php?caption=5' but it should be '/Search_form/search_results.php?photograpgher_id=1&photographer=x&image=x&Submit=Search&page=1?caption=5' as I have type this in manually and works fine any help would be appreciated Link to comment https://forums.phpfreaks.com/topic/278448-get-request-on-page-removing-post-information/ Share on other sites More sharing options...
mac_gyver Posted May 27, 2013 Share Posted May 27, 2013 when a method='get' form is submitted, only the form fields are append to the url. you would need to pass any existing get parameters as hidden form fields. Link to comment https://forums.phpfreaks.com/topic/278448-get-request-on-page-removing-post-information/#findComment-1432625 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.