PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Feb 24, 2020 8:56 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: 4.2 passing varibles
PostPosted: Fri May 03, 2002 8:14 am 
Offline
Forum Commoner
User avatar

Joined: Thu May 02, 2002 6:31 pm
Posts: 45
I am having trouble passing varibles from page to page in ver 4.2 I am using the exact same scripts as with previous versions, but keep getting the error:

Notice: Undefined variable:


Any thoughts?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 03, 2002 8:28 am 
Offline
Forum Commoner
User avatar

Joined: Wed May 01, 2002 2:44 am
Posts: 28
Location: Sydney -AU


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 03, 2002 8:33 am 
Offline
Site Admin

Joined: Thu Apr 18, 2002 3:14 pm
Posts: 1767
Location: Montreal, CA
riley: Remember, in PHP 4.2, the php.ini setting register_globals is off by default.

I suggest changing the setting from off to on in your php.ini file.

However, I also recommend using $_POST and $_GET

So before, if you had a variable passed from a form called $username, you would use

$_GET['username'] for forms passed via get and $_POST['usrname'] for forms passed via post.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 03, 2002 9:48 am 
Offline
Forum Commoner
User avatar

Joined: Thu May 02, 2002 6:31 pm
Posts: 45


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 03, 2002 10:07 am 
Offline
Forum Commoner
User avatar

Joined: Sat Apr 20, 2002 5:21 am
Posts: 25
Location: Glasgow UK


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 03, 2002 11:00 am 
Offline
Site Admin

Joined: Thu Apr 18, 2002 3:14 pm
Posts: 1767
Location: Montreal, CA
riley: Also, using $_GET and $_POST force you to write more secure code. Check out http://www.phpadvisory.com for more information on security.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 07, 2002 10:19 am 
Offline
Forum Commoner

Joined: Tue May 07, 2002 10:19 am
Posts: 26
Location: Buenos Aires, Argentina
I read the replies because I have the same problem(undefined variables message).I changed the php.ini file but I still have the problem in a page where the variable hasn't been used before. Could it be the problem? I didn't restarted windows but I don't think that it's necesary. Could you help me?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group