php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43607 I follow the documentation and get problems
Submitted: 2007-12-16 17:19 UTC Modified: 2007-12-24 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: eag2001 at terra dot es Assigned: colder (profile)
Status: No Feedback Package: Documentation problem
PHP Version: Irrelevant OS: Sindows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-12-16 17:19 UTC] eag2001 at terra dot es
Description:
------------
I have installed PhP in Windows SP in ISAPI.
I have followed the instructions of the documentation: 
PHP Manual-> A simple tutorial-> Dealing with forms
Example 2.6. A simple HTML form


<form action="action.php" method="post">
 <p>Your name: <input type="text" name="name" /></p>
 <p>Your age: <input type="text" name="age" /></p>
 <p><input type="submit" /></p>
</form>

and then

Hi <?php echo htmlspecialchars($_POST['name']); ?>.
You are <?php echo (int)$_POST['age']; ?> years old.

And it does not work !!!!

I have lost 2 hours to know that I can solve this problem changing the php.ini file-> register_globals to on.
Why did they change to off?
Is ther other any other better solution? (if they move to off from the previous vertion is because they found a way to get POST working in other better way, I presume)
Why there is not documentation about this requirement?

I think is important to help new people to start php without headaches, do you agree?

Thanks


Reproduce code:
---------------
<form action="action.php" method="post">
 <p>Your name: <input type="text" name="name" /></p>
 <p>Your age: <input type="text" name="age" /></p>
 <p><input type="submit" /></p>
</form>

and then

Hi <?php echo htmlspecialchars($_POST['name']); ?>.
You are <?php echo (int)$_POST['age']; ?> years old.

Expected result:
----------------
Hi Emilio You are 100 years old.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-16 19:01 UTC] colder@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


$_POST is filled even if register_globals is off. 
register_globals defaults to off and should remain off as it is removed from PHP6.
 [2007-12-24 01:00 UTC] doc-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 07:01:27 2024 UTC