if($test != ''){ print 'test'; }
this script give an undefined variable error.
how can u solve this kind of problem?
thank you in advance.
Assign $test to something first. Like:
$test = ''; if($test != '') print 'test';
well bascially that will do.. but i dont like assigning the test coz i want to get the test from the form. but im not saying that the value of the of the $test has always content and it will going to get even a blank or space value..
so how do u fix this?
You need to get the value from the form then. Lets assume you're using post to submit the form:
$test = $_POST['test'];
Or something like that will do. Then your if() should work fine...
Or check to see if the variable has any value before using.
if (isset($test)) { // Know it has something }
problem solve by configuring something from php.ini
thanky ou anyway 🙂
Don't tell me you're turned register_globals on... smacks forehead
I'm guessing the PHP directive error_reporting was turned way down as to make all those warnings and notices automagically disappear! Good little programmers code with E_ALL and don't create errors like E_NOTICE all over the place... just something to keep in mind 🙂