How to set "redirect" value
Posted by aji
|
February 13, 2007 05:17PM |
Admin Registered: 21 years ago Posts: 8,532 |
If the code "$myownredirect=='foo'" works for you, then you probably are running PHP with register_globals enabled. Beware that doing so is a security risk, since software might easily introduce security holes in this type of setup. The PHP people also advice against this. Unless you really need register_globals for some software on your server, you'd better disable that feature in PHP.
The way to access GET parameters is nowadays through the global $_GET array. If you post a get parameter "myownredirect", then it is available as $_GET["myownredirect"]. The isset() check is done to prevent warning about undefined indexes if you directly try to access $_GET["myownredirect"] (because the index "myownredirect" might not exist in the $_GET array). I guess that on your system PHP warnings are also suppressed in the PHP config, else the "$myownredirect=='foo'" would also throw a warning in case the parameter wasn't posted I think.
If this does the job for you and you're happy with the setup, then great. For others I'd like to recommend the code which uses the $_GET array instead.
BTW: It sounds like $_GET isn't availble at all on your system DonTino. What version of PHP are you running anyway?
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
The way to access GET parameters is nowadays through the global $_GET array. If you post a get parameter "myownredirect", then it is available as $_GET["myownredirect"]. The isset() check is done to prevent warning about undefined indexes if you directly try to access $_GET["myownredirect"] (because the index "myownredirect" might not exist in the $_GET array). I guess that on your system PHP warnings are also suppressed in the PHP config, else the "$myownredirect=='foo'" would also throw a warning in case the parameter wasn't posted I think.
If this does the job for you and you're happy with the setup, then great. For others I'd like to recommend the code which uses the $_GET array instead.
BTW: It sounds like $_GET isn't availble at all on your system DonTino. What version of PHP are you running anyway?
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: How to set "redirect" value February 14, 2007 03:54AM |
Registered: 19 years ago Posts: 70 |
Hi Maurice,
thanks for that good answer. Explains a lot to me.
I actually have 4.4.1 with register globals on yes. However this is a shared server of a big company and I'm not sure if they will change this just for me.
Right now I'm happy with the result. It works and that's the solution to my problem right now. However I'll keep your post in mind and see if I'll be able to fix this whenever I get to this and may be when the site is more popular.
I don't get any warnings on this one? However I think the warnings ar still turned on I get a lot of them on other occassions when I'm scripting something.
Thanks for all your help
Discover the Divine Truth | [www.discoverthedivinetruth.com]
thanks for that good answer. Explains a lot to me.
I actually have 4.4.1 with register globals on yes. However this is a shared server of a big company and I'm not sure if they will change this just for me.
Right now I'm happy with the result. It works and that's the solution to my problem right now. However I'll keep your post in mind and see if I'll be able to fix this whenever I get to this and may be when the site is more popular.
I don't get any warnings on this one? However I think the warnings ar still turned on I get a lot of them on other occassions when I'm scripting something.
Thanks for all your help
Discover the Divine Truth | [www.discoverthedivinetruth.com]
Sorry, only registered users may post in this forum.
