You are here: PHP form POST question « PHP « IT news, forums, messages
PHP form POST question

Posted by James on 01/10/05 04:04

I just narrowed something down about forms and POST and would like
education. In the following scenarios, all work except #4. $_POST is
null. Why is that?

Setup:
1) Running on localhost
2) /foo/index.php has the following:
<? var_dump($_POST); var_dump($_GET); ?>
3) /index.php contends vary per scenario (below)

Running RHEL 3, all updates (PHP 4.3.2).

SCENARIO 1:
/index.php contains the following:

<form method="get" action="/foo/index.php">
<input name="foobutton" type="submit">
</form>

In this case in /foo/index.php $_GET has the right value, i.e.
array('foobutton' => '');

SCENARIO 2:
/index.php contains the following:

<form method="get" action="/foo">
<input name="foobutton" type="submit">
</form>

In this case in /foo/index.php $_GET has the right value, i.e.
array('foobutton' => '');

SCENARIO 3:
/index.php contains the following:

<form method="post" action="/foo/index.php">
<input name="foobutton" type="submit">
</form>

In this case in /foo/index.php $_POST has the right value, i.e.
array('foobutton' => '');

SCENARIO 4:
/index.php contains the following:

<form method="post" action="/foo">
<input name="foobutton" type="submit">
</form>

In this case in /foo/index.php $_POST is NULL.

HUH? Why is $_POST empty? Is Apache doing something to kill the form's
post information when it has to resolve /foo to /foo/index.php?

 

Navigation:

[Reply to this 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

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