Re: My Short Variable is not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/22/05, Afolabi Richard <richardesquire@xxxxxxxxx> wrote:
> Hi all,
> 
> I am a PHP newbie using WAMP5 version 1.1
> 
> I have tried coding PHP and I see it as very interesting and fascinating. however, I have a > challenge: My short variables e.g "$names", "$email"  are not working when I use "echo" > command with it, except I use "echo $_POST[fieldname]". meanwhile, I set the
> "global_registers = On" in my php.ini file but the story is the same.
It's register_globals, and it shouldn't be turned on.  It allows
ANYONE to define ANY VARIABLE in your script.  Not a good idea. 
Search your php.ini file for the phrase "register_globals" and set it
to on, and the sample you attached will work (even though it's
insecure).

Also, you should do $_POST["fieldname"] instead of $_POST[fieldname]. 
They'll both work (I believe) but the first is the correct way to do
it, you are accessing a named key with the name of that string.

> 
> Is there something else I have not done, pls help I am getting to LOVE PHP and MYSQL.

Good, I agree...It can be really fun once you get to know it!


-- 
PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux