|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-12-05 15:20 UTC] webmaster at vop dot com
I downloaded the latest PHP version hoping that it will work, but everytime I try to run PHP script it won't run, it will say undefined variable, especially when I use form, when I clicked submit the php won't recognize the variable from the form. I unstalled the 4.2.3 and installed the 4.06 and the problem solved. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 11:00:01 2025 UTC |
Some more notes about the issue. Even if I have a script as simple as this it will not work properly. --- <?php if (!$text) { $text = "Enter Text Here"; } ?> <form action="temp.php" method="post" enctype="multipart/form-data" name="form1"> <input name="text" type="text" id="text" value="<?php echo $text; ?>"> <input type="submit" name="Submit" value="Submit"> </form> --- This is the error message it gives me. I see that there are a number of reports of similar problems. Here is the error message it returns.... Notice: Undefined variable: text in d:\---filepath---\temp.php on line 1I'm sure this is about to be set bogus as this isn't an error with PHP. That's a Notice, first of all, not an error. A Notice is just for your own enlightenment. The problem is that you're using a variable that's not defined and that generates a notice. You can fix this in one of a multitude of ways. The first and easiest is to turn off notices. In your php.ini file, set error_reporting = E_ALL & ~E_NOTICE This will stop notices from being displayed, but this will just stop the symptom. The better way is to use this in your script: if(!isset($text)) { $text = 'blah'; } Please refrain from posting bugs unless you KNOW FOR CERTAIN that it is a bug. It is much better to post to a newsgroup or mailing list for help rather than submitting a bug (as normally, you get NO help when submitting a bogus bug). See http://www.php.net/support.php