| Index
» Projects
» phpMyEdit
» Forum
» Filter and send variable |
 |
Joss
Joined: 02 Apr 2012
Posts: 3
Posted: 2012-04-02 16:22
Back to top
Reply with quote
|
Hello! First of all, sorry for my english. I hope that you can understand me XD
I use phpMyEdit lot and i have a problem.
I want use session vars in my web for register the username. The problem is that when i do a filter of the table results, the session var that save the username is empty.
If i do not do a filter, the session var, save the username perfectly.
Is there any method to make the session dont erase?
Thank you so much!!!!
|
Joss
Joined: 02 Apr 2012
Posts: 3
Posted: 2012-04-11 12:45
Back to top
Reply with quote
|
Hello again!
I've been looking for information and i think that a way for resolve the problem is using 'persist'.
My code is this...
$opts['cgi']['persist'] = array ('user' => $_GET['user_name']);
Is that correct?
Now, How I can see the value of the variable?
After making a filter, i do this..
echo $opts['cgi']['persist']['user'];
But i dont see the value, only before filter.
Thanks!!!
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2012-04-11 16:12
Back to top
Reply with quote
|
Given that you have not posted any code, it is unlikely anyone can guess all that is going on.
If you are using sessions and a user is logged in, what does this code display:
| Code: |
$print_r_text = preg_replace('/\n/s', "\r\n", print_r($_SESSION, true));
echo !stristr($print_r_text, ']') ? '' : "\n".'<p>$_SESSION</p><pre>'.htmlspecialchars($print_r_text).'</pre>'; |
|
Joss
Joined: 02 Apr 2012
Posts: 3
Posted: 2012-04-11 22:07
Back to top
Reply with quote
|
You are right, doug. Excuse me, it's hard for me to speak in english.
Also, i made a mistake because in the first post i said that used session vars, but in the second post i use a variable that send by get method.
I have a file generated by phpMyEdit, ventas.php
This file show the result of a table of my database.
I want to know who user is logged on, to do this, i have this data in a session variable.
$nombre_usuario = $_SESSION['usuario'];
If i do that... echo $nombre_usuario;
I see the name of user, but if i do anything with the table (filter,order, etc.) I lost this data.
How i can save this variable although i do any operation??
I think that i can resolve this problem with 'persist', i have used it doing....
$opts['cgi']['persist'] = array ('user' => $nombre_usuario);
But it's the same, the value disappear if i do any operation.
Thanks for your answer!!
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2012-04-11 23:02
Back to top
Reply with quote
|
It sounds as if your problem has been solved.
When in doubt about what variables are populated, include the following dBug.php script in your page footer.
http://dbug.ospinto.com/
After inclusion then
| Code: |
new dBug($GLOBALS);
// or
// new dBug($opts); |
|
|
Post new topic
Reply to topic
|
|
|
|