note 42025 deleted from language.variables by aidan
| From: | aidan@php.net | Date: | Sat, 18 Sep 2004 04:44:23 +0000 |
| Subject: | note 42025 deleted from language.variables by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76917@lists.php.net to get a copy of this message | ||
Note Submitter: webmaster at lapinbleu dot ch
----
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)