RE: [PHP-WIN] Windows2000 OS - PHP 4.x - Warning: Undefined varia ble:

From: Date: Mon, 13 Nov 2000 13:37:19 +0000
Subject: RE: [PHP-WIN] Windows2000 OS - PHP 4.x - Warning: Undefined varia ble:
Groups: php.windows 
Request: Send a blank email to php-windows+get-3806@lists.php.net to get a copy of this message
What's happening is if you send the form with that box empty, there is no data in the variable you are trying to trim. To fix this, you could do something like this: if ( isset ( $SearchValue ) ) { $strSearchValue = trim($SearchValue); } This way, the variable will be skipped if there is nothing inputted. John --------------------- Founder of The 'What Kind of Idiot Uses PHP with IIS with Oracle on NT?' Consortium Members: John Asendorf, Thomas Kryger, Florian Clever, Ron Woods John Asendorf - jasendorf@lcounty.com Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 > -----Original Message----- > From: Vasu [mailto:gokaraju@hotmail.com] > Sent: Friday, November 10, 2000 7:51 PM > To: php-windows@lists.php.net > Subject: [PHP-WIN] Windows2000 OS - PHP 4.x - Warning: Undefined > variable: > > > I developed a PHP program on Linux 6.2 OS and tested on > Windows 2000 OS. It gives "Undefined variable:" error > message for the variables that are not declared before. > > For example, > > the line of code that I am getting error at is : > $strSearchValue = trim($SearchValue); > > and the error message is: > Warning: Undefined variable: SearchValue in > D:\MDLines\admin\department\DepartmentIndex.php on line 57 > > The variable $SearchValue is the name of a text box of HTTP > Form. If there is a value in the text box before the form is > submitted, no error occurs. Problem is only when the element > is empty before the form is submitted. > > This program works fine on Linux OS but not on Windows 2000 > OS. I have PHP 4.x installed on both the operating systems. > I am not sure whether I can use PHP 4.x on Windows2000 OS but > it seems okay other than this problem. > > Please send your suggestions and appreciate your help. > > Vasu >

« previous php.windows (#3806) next »