On Wed, Jul 17, 2002 at 02:11:50PM +0530, Arvind wrote:

>if i try to get the form variables ( posted thru GET or POST method)
>
>this does not work
>
>$whichtab = $tab;
>
>Earlier this used to work without any problems. After I upgraded to PHP
>4.2.1 i am facing these problems.
>
>
>i have to specify this explicitly ( as specified below) and only then
>$whichtab gets populated else, it is NULL.
>$whichtab = $HTTP_GET_VARS["tab"]
>
>or
>
>$whichtab = $HTTP_POST_VARS["tab"]
>
>Can anybody tell me, what could be the problem ? Has it got somthing to do
>with any env. var setting in Linux ?

The reason is by default in PHP 4.2.x 

register_globals=off.

<snip from php.ini>
; You should do your best to write your scripts so that they do not require
; register_globals to be on;  Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = On
<snip from php.ini>

If you make register_globals=on than it will work as you want. I also faced
similar problem a few days back and Rohan pointed me to above. As specified
in the above comments making it 'oon' is security risk.

It is good practice to use $HTTP_POST_VARS or $HTTP_GET_VARS.

Peace

--
Rajesh
:
####[ Linux One Stanza Tip (LOST) ]###########################

Sub : Reducing processes needed                      LOST #105

An attempt should be made to  reduce number of processes where
ever possible ... example  "cat filename | less"  is valid but
evokes 2 processes. The same is possible with "less filename",
with only one process evoked.

####<[EMAIL PROTECTED]>########################################
:


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to