|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21192 Problems with variables
Submitted: 2002-12-26 06:54 UTC Modified: 2003-01-06 12:29 UTC
From: vieste dot perugia at tiscali dot it Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 4.2.3 OS: Windows XP Home Ed
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: vieste dot perugia at tiscali dot it
New email:
PHP Version: OS:


 [2002-12-26 06:54 UTC] vieste dot perugia at tiscali dot it
Dear Sirs,

I have recently installed PHP v.4.2.3 on a Windows XP Home Edition system equipped with an Apache HTTP Server v.1.3.24 and MySQL v.4.0.3.

I believe the installation was completed successfully since I have already managed to create simple databases with PHP and MySQL and insert, update and delete tables and records.

In spite of this, I have encountered a problem dealing with variable settings that is literally driving me crazy. I'll try to explain it in very few words.

If I populate a table using the following code, everything works perfectly:

@mysql_connect("localhost", "root", "") or die ("Sorry. Could not connect to the DB!");
@mysql_select_db("mydb") or die ("Sorry. Coluld not open the DB!");           
@mysql_query("insert into mytable (field1,field2) values ('First field value','Second field value')") or die("Sorry. Could not insert data!");
//***END OF CODE***

Nevertheless, if I try to specify the field values by means of variables corresponding to the values of text boxes, the variables are not recognized by PHP and I get an error message. So the problem is, I can't import variables from text boxes!

In order to simplify what I mean, the following basic code, saved in a file called "test.php", originates an error on my system:

<input type="text" name="mytext" value="Hello world!">


echo "$mytext";

//***END OF CODE***

When I execute the code above, all I get is the following error message:

Notice: Undefined variable: mytext in c:\program files\apache group\apache\htdocs\test.php on line 5

I would very much like to understand the reason why such elementary lines of code don't work on my system. Please if you have the answer to my question, help me. If possible, notify me at the following e-mail address:

Thanks in advance for your help.

Yours faithfully,

Pasquale Esposito
Perugia (Italy)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-26 06:57 UTC]
In PHP 4.2.0, the 'register_globals' setting default changed to
'off'. See for more info.
We are sorry about the inconvenience, but this change was a necessary
part of our efforts to make PHP scripting more secure and portable.
 [2003-01-06 09:19 UTC] lucaalv at tiscalinet dot it
Dear sirs, 
I have the same problem of Pasquale. I have already changed the parameter "register_globals on" but my script doesn't recognize the variables passed from the form with GET method.
PHP v.4.2.3 and APACHE 1.3.27 on Windows XP
Can you help me? Thank you! 
 [2003-01-06 12:29 UTC] vieste dot perugia at tiscali dot it
Thank you very much for your help. I have changed the 'register_globals' setting and everything has fallen into place. Anyway, I also had to use the POST method to make it work.

Best regards.

Pasquale Esposito
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 03:01:32 2024 UTC