Notice: Undefined variable:

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


Joined: 10 Aug 2005
Posts: 2

PostPosted: Wed Aug 10, 2005 1:19 am    Post subject: Notice: Undefined variable: Reply with quote

I've read the other topics on this, and tried editing my php.ini to no avail.

My php.ini file can be read as a .txt http://68.56.153.72/php.txt there.

Basically you go to http://68.56.153.72/test/index.php and enter in the # of inmates you want input boxes for (1-35 or so).

I put in "2" w/o the "" in the input box and I get the error:

Quote:
Notice: Undefined variable: inmates in C:\Program Files\Abyss Web Server\htdocs\test\inmate.php on line 19

Notice: Undefined variable: inmatename in C:\Program Files\Abyss Web Server\htdocs\test\inmate.php on line 21

Notice: Undefined variable: inmates in C:\Program Files\Abyss Web Server\htdocs\test\inmate.php on line 24


I know this is not my code that is messed up because it works perfectly on other servers that aren't abuss.

The source code to my index and inmate.php can be viewed at:
http://68.56.153.72/inmate.txt and http://68.56.153.72/index.txt

PLEASE NOTE I have replaced all < tags with : so that the source would show.

I have abyss version1 the free one, and php 5 installed. When I do a file like $foo = "bar"; echo "$foo"; it outputs fine, it's just when I do form submitting it won't work unless I put $var = $_POST['var']; But I cannot do that with my system because the inmate boxes are dynamic.
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Aug 10, 2005 1:33 am    Post subject: Reply with quote

You seem to have two php.ini files , look in your C:\Windows and PHP folder for
the php.ini files , delete the one thats causing your other settings from working.

Note: This error comes from PHP , it has nothing to do with the Server.

Sincerely , TRUSTpunk
Back to top View user's profile Send private message Visit poster's website
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Wed Aug 10, 2005 1:52 am    Post subject: Re: Notice: Undefined variable: Reply with quote

Earle wrote:
I've read the other topics on this, and tried editing my php.ini to no avail.

My php.ini file can be read as a .txt http://68.56.153.72/php.txt there.

Basically you go to http://68.56.153.72/test/index.php and enter in the # of inmates you want input boxes for (1-35 or so).

I put in "2" w/o the "" in the input box and I get the error:

Quote:
Notice: Undefined variable: inmates in C:\Program Files\Abyss Web Server\htdocs\test\inmate.php on line 19

Notice: Undefined variable: inmatename in C:\Program Files\Abyss Web Server\htdocs\test\inmate.php on line 21

Notice: Undefined variable: inmates in C:\Program Files\Abyss Web Server\htdocs\test\inmate.php on line 24


I know this is not my code that is messed up because it works perfectly on other servers that aren't abuss.

The source code to my index and inmate.php can be viewed at:
http://68.56.153.72/inmate.txt and http://68.56.153.72/index.txt

PLEASE NOTE I have replaced all < tags with : so that the source would show.

I have abyss version1 the free one, and php 5 installed. When I do a file like $foo = "bar"; echo "$foo"; it outputs fine, it's just when I do form submitting it won't work unless I put $var = $_POST['var']; But I cannot do that with my system because the inmate boxes are dynamic.


Or you could use $_POST['inmates'] and $_POST['inmatename'] which should clear the notices. (Not actually sure, too lazy to test.)
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
k1ll3rdr4g0n
-


Joined: 04 Jul 2004
Posts: 609

PostPosted: Wed Aug 10, 2005 2:24 am    Post subject: Reply with quote

For all my scripts I use

Code:
if (isset($thevar)) {
$othervar = $thevar;
}


That gets rid of the notice messages.
_________________
Back to top View user's profile Send private message AIM Address
Earle
-


Joined: 10 Aug 2005
Posts: 2

PostPosted: Wed Aug 10, 2005 4:04 am    Post subject: Reply with quote

post #2 - That won't work because I have like 40 vars for inmate0 inmate1, all the way to inmate40, and there is no way to check if the inmate (isset) because it's not passing them correctly.

post #3 - I don't want to just hide the errors, I wanted to fix them.

post #1 - Thanks a million, I found a php.ini in C:\Windows that I didn't know about, replaced that with the one from my C:\PHP I had edited and it now works like a charm!
Back to top View user's profile Send private message
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Wed Aug 10, 2005 4:24 am    Post subject: Reply with quote

Earle wrote:
post #2 - That won't work because I have like 40 vars for inmate0 inmate1, all the way to inmate40, and there is no way to check if the inmate (isset) because it's not passing them correctly.

post #3 - I don't want to just hide the errors, I wanted to fix them.

post #1 - Thanks a million, I found a php.ini in C:\Windows that I didn't know about, replaced that with the one from my C:\PHP I had edited and it now works like a charm!


Could be done, just set $arraykey = "inmate".$incr and $_POST[$imcr] with $incr++ in the loop. Or a error_reporting(0) on the page =P
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
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