IER506 Posted July 5, 2010 Share Posted July 5, 2010 Good morning to everyone. I am a newbie in php but I'm trying hard! I really like it but I'm stuck in a project I'm preparing and any help is appreciated. I have a form with post method which creates/changes a main query I want to run. When an element changes inside my form, the page is reloaded but the values are kept as they should. I've done it with several switch commands. Here is an example: function isset_or(&$check, $alternate = NULL) { return (isset($check)) ? $check : $alternate; } $order = isset_or($_POST['order'], 0); switch($order) { case 0: $ = ' selected'; $o1 = ''; $queryorder = ' ASC'; break; case 1: $o1 = ' selected'; $ = ''; $queryorder = ' DESC'; break; } $ordermenu = '<select name="order" onchange="this.form.submit();"> <option value="0"'.$.' >Ascending</option> <option value="1"'.$o1.' >Descending</option> </select>'; The problem is that each time I press a link of the pagination the form data are lost and the form is reset to it's initial condition! Can you please give me some ideas on how to bypass this problem? Link to comment https://forums.phpfreaks.com/topic/206823-pagination-and-_post-problems/ Share on other sites More sharing options...
IER506 Posted July 6, 2010 Author Share Posted July 6, 2010 Problem solved by replacing links with submit elements.They work fine now! Link to comment https://forums.phpfreaks.com/topic/206823-pagination-and-_post-problems/#findComment-1082177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.