Index
» Projects
» phpMyEdit
» Forum
» CGI persist suddenly not persisting? |
|
jtzako
Joined: 12 Jan 2017
Posts: 16
Posted: 2017-01-18 21:15
Back to top
Reply with quote
|
I have a CGI Persist in my page and it had been working but today it has stopped working and I cant figure out why.
I got the code here in another post because I wanted to filter by month based on a field in my DB.
I can still do the filter by clicking one of my filter buttons (or by putting ?month=01 in the URL).
However, if I Add or Change a record the ?month= disappears and I go back to default.
$month = array_key_exists('month', @$_REQUEST) ? strip_tags(stripslashes(trim(@$_REQUEST['month']))) : '';
if($month > '') {
$opts['cgi']['persist'] = array('month' => $month);
$opts['filters'] = 'CMDate REGEXP "^'.$month.'"';
// echo "\n".'<p><font color=black>'.htmlentities($opts['filters'], ENT_QUOTES, 'UTF-8').'</font></p>';
}
|
jtzako
Joined: 12 Jan 2017
Posts: 16
Posted: 2017-01-18 21:25
Back to top
Reply with quote
|
Ok, here's something odd. Without changing anything it suddenly started working again.
It isnt keeping the month= in the URL though. I'm not sure why, I thought that would have stayed in place.
However, the filter seems to be working based on what the month= was most recently set to.
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2017-01-18 23:18
Back to top
Reply with quote
|
Sometimes browsers can get messed up. Clear the cache and/or try a different browser.
The posted code indicates persistence only when the month is non-empty (has a value).
To verify which variables are set, try including dBug.php in your footer: http://dbug.ospinto.com/
-or-
// ksort($_REQUEST);
$print_r_text = preg_replace('/\n/s', "\r\n", print_r($_REQUEST, true));
echo !stristr($print_r_text, ']') ? '' : "\n".'<p>$_REQUEST</p><pre>'.htmlspecialchars($print_r_text).'</pre>';
|
Post new topic
Reply to topic
|
|
|
|