Did something change RE: PHP from XAMPP 1.5.0 to 1.5.3a?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Did something change RE: PHP from XAMPP 1.5.0 to 1.5.3a?

Postby vegtabill » 14. July 2006 17:32

Hello again,

Here's the situation I have:

Last year we were using XAMPP 1.5.0 with PHPEclipse. We had a number of examples and assignments dealing with HTML forms passing data to PHP pages. Last year's pages used the POST or GET data from the HTML forms in "regular" old PHP variables. For example, if the HTML form had a text field like this:

<input type="text" name="age">

... the PHP page would display the POST data like this:

echo ("Your age is $age.");

... and it worked as expected.

This year, using XAMPP 1.5.3a, the very same HTML forms and PHP pages are not working unless $_POST['age'] is used. In other words, PHP isn't automatically reading the POST data in and linking it to the appropriate variable based on the name attribute from the HTML form.

I said before that I'm not a Perl expert. Well, I'm a novice at PHP too. I'm a Java guy, tasked with putting these tools together to teach classes this fall. So when this little issue cropped up, I truly found myself at a loss.

Can anyone give me an indication why last year's method worked before but doesn't now? And why it will work if we supply the $_POST, $_GET or $_REQUEST "tags". I sure would appreciate any insights!

Thanks in advance!
Veg

By the way, I should add that I am not the one teaching PHP! Don't want anyone thinking such a grossly unqualified individual might be taking on that task. I'm just putting the tools in the toolkit and making sure they work together!
User avatar
vegtabill
 
Posts: 8
Joined: 04. July 2006 20:17
Location: Salem, Va., USA

Postby Wiedmann » 14. July 2006 17:55

In other words, PHP isn't automatically reading the POST data in and linking it to the appropriate variable based on the name attribute from the HTML form.

Right, this is the default behaviour since 5-6 years in PHP. Please read the PHP manual about "external variables".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby vegtabill » 14. July 2006 18:51

Thanks for the reply. That pointed me in the right direction, and I see what you were talking about.

For what it's worth, php.ini in XAMPP 1.5.0 had "register_globals" set to "On"., whereas 1.5.3a has this directive set to "Off". So in case anyone else was wondering, there *is* a difference between the two versions regarding how PHP is configured.

I do understand that "Off" is preferred now, so I appreciate your help in getting me up to speed. As I said, I'm not a PHP dude!

Thanks for the help!
Veg
User avatar
vegtabill
 
Posts: 8
Joined: 04. July 2006 20:17
Location: Salem, Va., USA

Postby shutout5591 » 03. October 2006 22:13

Please make this post sticky! It took me so long to realize this was the issue. A lot of old scripts I was using, and one I made, didn't work cuz of this!

VERY USEFUL POST!!!!! :D :D :D :D
shutout5591
 
Posts: 6
Joined: 02. April 2006 16:47

Postby vegtabill » 04. October 2006 04:58

Glad to know I'm not the only one!

Veg
User avatar
vegtabill
 
Posts: 8
Joined: 04. July 2006 20:17
Location: Salem, Va., USA


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 123 guests