help if possible

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
elan123
Forum Newbie
Posts: 2
Joined: Mon Feb 12, 2007 6:08 am

help if possible

Post by elan123 »

Hi All,

Is this possible to get the values of the HTML form on the other page without using the _GET or _POST super global variable ?

If yes then please tell me how can i do it.
Note: i think it is possible by changing php.ini file's setting

Thank in advance
Chaitenya
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Previous versions of PHP did have an option "register_globals" which could be set. This was switched off in PHP5 by default (previously it defaulted to on). The main reason... SECURITY with a side reason of side effects which were difficult to track down. PHP6 will remove this option entirely.

Using $_POST or $_GET is good practice and not difficult. Can you give a reason why you would not want to use them ?

If you need to retain values for some reason, try using sessions.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

If it's an issue of comfortability, just give your posted variables regular names early on in the code.

Code: Select all

if(isset($_POST['name'])) $name = $_POST['name'];
Beyond that, I can't see much reason to avoid $_POST and $_GET.
elan123
Forum Newbie
Posts: 2
Joined: Mon Feb 12, 2007 6:08 am

Post by elan123 »

Thanks a lot Mr CoderGoblin.
My problem get solved by your kind help.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

elan123 wrote:My problem get solved by your kind help.
Then please edit the Subject of this post from: help if possible to: help if possible [SOLVED].
Post Reply