note 42025 added to language.variables
| From: | webmaster at lapinbleu dot ch | Date: | Thu, 29 Apr 2004 21:48:03 +0000 |
| Subject: | note 42025 added to language.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69014@lists.php.net to get a copy of this message | ||
Want to be the only one to modify variables through the URL?
Here could be the solution:
$i = 0;
$query_list = explode ("&",$QUERY_STRING);
$query_list_nb = count ($query_list);
while ($i<$query_list_nb)
{
$varstr = explode ("=",$query_list[$i]);
$varname = $varstr[0];
$var_label_string = "$varname";
if (($varname!="nameof1stvar") & ($varname!="nameof2ndvar") &
($varname!="nameof3rdvar"))
{
${$var_label_string}=0;
}
$i++;
}
With this code, only the url http://yourwebsite.com/?nameof1stvar=x&nameof2ndvar=y&nameof3rdvar=z
will do something in your code... Any else variable in the url will be equal to zero.
Want to be helped: try to join me at www.lapinbleu.ch (speaking also French)
----
Manual Page -- http://www.php.net/manual/en/language.variables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42025
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42025&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42025&report=yes
Search -- http://master.php.net/manage/user-notes.php