<br><br><div class="gmail_quote">On Tue, Apr 3, 2012 at 8:23 PM, Marc Delisle <span dir="ltr"><<a href="mailto:marc@infomarc.info">marc@infomarc.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Le 2012-04-02 18:39, Ammar Yasir a écrit :<br>
<div class="im">> Hi,<br>
> Can we have more clarity on improving reference to global variables. Is the<br>
> following snippet an example of the same where?<br>
> (From tbl_select.php, $_POST parameters are referenced through $GLOBALS)<br>
> $post_params = array(<br>
>     'ajax_request',<br>
>     'collations',<br>
>     'db',<br>
>     'distinct',<br>
>     'fields',<br>
>     'func',<br>
>     'max_number_of_fields',<br>
>     'names',<br>
>     'order',<br>
>     'orderField',<br>
>     'param',<br>
>     'session_max_rows',<br>
>     'table',<br>
>     'types',<br>
>     'where',<br>
> );<br>
> foreach ($post_params as $one_post_param) {<br>
>     if (isset($_POST[$one_post_param])) {<br>
>         $GLOBALS[$one_post_param] = $_POST[$one_post_param];<br>
>     }<br>
> }<br>
<br>
</div>Ammar,<br>
this snippet is code added recently, to be able to remove the<br>
grab_globals.lib.php library.<br>
<br>
tbl_select.php uses globals instead of directly referencing<br>
$_POST['foo'] so this snippet was a way to keep the script working until<br>
better refactoring.<br>
<br>
However, many scripts are using other global variables as a way to<br>
communicate between them or between functions, and we should try to<br>
minimize this behavior.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div>Is the use of $sql_query variable as a GET variable for sql.php  an example of the same?</div><div>(communication between scripts) </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">
--<br>
Marc Delisle<br>
<a href="http://infomarc.info" target="_blank">http://infomarc.info</a><br>
<br>
</div></div><br>------------------------------------------------------------------------------<br>
Better than sec? Nothing is better than sec when it comes to<br>
monitoring Big Data applications. Try Boundary one-second<br>
resolution app monitoring today. Free.<br>
<a href="http://p.sf.net/sfu/Boundary-dev2dev" target="_blank">http://p.sf.net/sfu/Boundary-dev2dev</a><br>_______________________________________________<br>
Phpmyadmin-devel mailing list<br>
<a href="mailto:Phpmyadmin-devel@lists.sourceforge.net">Phpmyadmin-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel</a><br>
<br></blockquote></div><br>