unknown variable error

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
zwt
-


Joined: 15 Jul 2002
Posts: 1

PostPosted: Mon Jul 15, 2002 1:57 pm    Post subject: unknown variable error Reply with quote

I came to the forums to check what was up when nothing I modified on the page worked. I read up on some of the posts and tried turning "register_globals" On in my php.ini file, but nothing changed. My only line of php code is:

Code:
<?php if ($id == "") { include "home.php"; } else { include "$id.php"; } ?>


and it worked fine on a free webhost i used to have (from wut ive read, it seems to be cuz of the latest php release)

neways, im a complete php newbie and dont understand any of the other stuff which was mention, so can sum1 please explain how to get that single line of code working one way or the other? :)
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Jul 15, 2002 2:59 pm    Post subject: Re: unknown variable error Reply with quote

zwt wrote:
I came to the forums to check what was up when nothing I modified on the page worked. I read up on some of the posts and tried turning "register_globals" On in my php.ini file, but nothing changed. My only line of php code is:

Code:
<?php if ($id == "") { include "home.php"; } else { include "$id.php"; } ?>


and it worked fine on a free webhost i used to have (from wut ive read, it seems to be cuz of the latest php release)

neways, im a complete php newbie and dont understand any of the other stuff which was mention, so can sum1 please explain how to get that single line of code working one way or the other? :)

This behaviour is caused by the new release of PHP which do not automatically register GET and POST variables as global.
Anyway, instead of using $id use $_GET['id'] or $_POST['id'] (depending on the method of the request).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
ruiner333
Guest





PostPosted: Sun Dec 22, 2002 11:36 am    Post subject: Reply with quote

Include this in the beginning of your program to register form vars as global.

Code:
import_request_variables("gpc","form_");


First parameter is what data to register globally.
g = get
p = post
c = cookie

Second parameter is an optional prefix to add to the variable name.
Back to top
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Sun Dec 22, 2002 2:15 pm    Post subject: Reply with quote

Aprelium is 100% right 8)

i don´t really undersand what you mean, ruiner 8O
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
gary
Guest





PostPosted: Mon Jan 13, 2003 1:30 am    Post subject: i add the code on my php.ini then nouse Reply with quote

ruiner333 wrote:
Include this in the beginning of your program to register form vars as global.

Code:
import_request_variables("gpc","form_");


First parameter is what data to register globally.
g = get
p = post
c = cookie

Second parameter is an optional prefix to add to the variable name.


wut happen no respond but no err occurred so wut the use?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB phpBB Group