![]() |
Preventing the Defining of Variables through urls
Sometimes I use some common variable names in my code, which is passed. How can I prevent that variable from being defined in the url for ex: http://www.domain.com/index.php?hits=1231231231232312
Or is it so that when the variable is already defined, it cannot be defined through url? Thanks |
in the first line of your script you can use unset($hits);
also if the varialbes are sent through a form, they will overwrite the urlvariables |
Ah...so what is isset?
|
So for example, before the rest of the code starts I would put
PHP Code:
also can you do this to multiple variables at once like? PHP Code:
|
if you unset the var, you can redifine it later in the script without any problems :)
look into global.php there are a lot of unsets :) i don't think you can unset more vars in one line... |
Quote:
eg: PHP Code:
|
Ah thanks, I checked on php.net and unsetting multiple variables seems to be possible.
Thanks Guys! |
All times are GMT. The time now is 01:01 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|