Reply to Re: $_POST array returns no data

Your name:

Reply:


Posted by techusky on 07/12/07 02:01

On Jul 11, 6:21 pm, Computer Guy <aaron.michalc...@gmail.com> wrote:
> On Jul 11, 6:35 pm, techu...@gmail.com wrote:
>
>
>
> > When I try to echo the $_POST array from a VERY simple form that I've
> > made for testing purposes, the array returns 0 no matter what I send
> > from the form. If I change the form's method from "post" to
> > "get," (and make the change from $_POST to $_GET in the php script)
> > it
> > runs just fine. I have also checked my php.ini file to verify that
> > the
> > "variables_order" directive is set to: EGPCS, the default.
>
> > My web server is running on Windows XP SP2 with Apache 2.2.4 and PHP
> > 5.2.1.
>
> > Here is the code I'm working with:
>
> > test.html:
>
> > <html>
>
> > <head>
> > <title>test</title>
> > </head>
>
> > <body>
> > <form action="./test.php" method="post">
> > Feet: <input type="text" name="feet">
> > <input type="submit" value="Convert">
> > </form>
> > </body>
>
> > </html>
>
> > test.php:
>
> > <?php
>
> > // Retrieve user's entry
> > $feet = $_POST['feet'];
>
> > // Convert $feet to $inches
> > $inches = ($feet * 12);
>
> > // Display $inches
> > echo "$inches";
>
> > ?>
>
> > If anyone has any suggestions, I have been wracking my brain over
> > this
> > all afternoon. Thanks.
>
> Well I would consider myself a php noob but I might as well throw out
> suggestions. First of all form action i would just make test.php
> (assuming it is same directory). Also I would just do
> echo $_POST['feet']; just to see if it is actually getting the value
> before you do anything to it
> hope that helps to some degree, if not wait for one of the pros to
> reply
>
> :D

Unfortunately that did not do anything for me... Making it just
"test.php" is no different, as the "./" simply indicates that the file
is in the same folder as the .html file. As for trying just "echo
$_POST['feet'];" ...well, I've done that as well to no avail.

Thank you, though!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация