Jump to content

Pagination and $_POST problems...


IER506

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.