php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17378 Getting Undefined Variable: error for variable taken from html page calling it.
Submitted: 2002-05-23 03:06 UTC Modified: 2002-05-23 03:10 UTC
From: sheenathilak at hotmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.1 OS: Windows NT
Private report: No CVE-ID: None
 [2002-05-23 03:06 UTC] sheenathilak at hotmail dot com
The content of text.html is

<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM METHOD=GET ACTION=text.php>
Who is your favourite author?
<INPUT NAME="author" TYPE="TEXT">
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>

The content of text.php is

<HTML>
<HEAD>
</HEAD>
<BODY>
<?php echo $author;
?>
</BODY>
</HTML>


When a name is entered and the submit button is clicked, it goes to the text.php and shows the following error.

Notice: Undefined variable: author in f:\Inetpub\wwwroot\Netproject\TestingSamples\text.php on line 5

PLEASE tell what to do about it AS SOON AS POSSIBLE.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-03 13:45 UTC] kencam at u dot washington dot edu
Same problem when running 1.3.23 Apache:

"Notice: Undefined variable: author in c:\apache\htdocs\text.php on line 5"

Note: IIS is also installed on same machine, though disabled.
 [2002-06-03 23:41 UTC] sheenathilak at hotmail dot com
There is a variable 'register_globals' in PHP.ini. If it is Off, change it to register_globals = On
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 13 18:00:01 2025 UTC