Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Filter and send variable

phpMyEdit General     Filter and send variable
Odoslať novú tému   Odpovedať na tému    
 
Joss     Založený: 02.04.2012   Príspevky: 3  
Príspevok Zaslal: 2012-04-02 16:22
Návrat hore  Odpovedať s citátom     

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     Založený: 02.04.2012   Príspevky: 3  
Príspevok Zaslal: 2012-04-11 12:45
Návrat hore  Odpovedať s citátom     

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     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2012-04-11 16:12
Návrat hore  Odpovedať s citátom     

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:

Kód:
$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     Založený: 02.04.2012   Príspevky: 3  
Príspevok Zaslal: 2012-04-11 22:07
Návrat hore  Odpovedať s citátom     

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     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2012-04-11 23:02
Návrat hore  Odpovedať s citátom     

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
Kód:
new dBug($GLOBALS);
// or
// new dBug($opts);


 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov