$_POST always empty

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am having trouble with PHP on Windows. Here'smy setup:

- PHP 5.3.0 on Windpws XP (tried both thrad-safe and non-thread-safe
versions, it make no difference to my problem);
- Microsoft Expression Web 2 which has its own web server ("Cassini");

The problem is my $_POST array is always empty. I found several reports on
the web from people having the same problem but if a solution was provided
it did not apply to me. The max_post_size variable in php.ini is fine.

I am doing a plain

  <form method="post" action="mypage.php">

I am checking the array using


My input controls have names. I tried version 5.2.10, again no difference.

On installation I tried "do not setup a web server" and "IIS CGI", not being
sure what the prefered setting would be. It made no difference, PHP works
but no $_POST data.

Even the most basic page won't work:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml ">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
echo "<pre>";
echo "</pre>";
 <form method="post" action="test.php">
  <input id="txtEmail" name="txtEmail" type="text" style="width:
  <input id="btnVerzenden" name="btnVerzenden" type="submit"
value="Verzenden" />


This wil return


no matter what I enter. Am I overlooking something obvious?

Regards, Martin.

Re: $_POST always empty

Hash: SHA1

Martin Maat wrote:
Quoted text here. Click to load it

Is the filename you write in the action="" the same as the file you try to run ?

if you run index.php with the form in it, the post will be send to test.php

j. ke▀ler
Version: GnuPG v2.0.11 (GNU/Linux)


Re: $_POST always empty

Martin Maat wrote:
Quoted text here. Click to load it
Did you actually submit the form?

Re: $_POST always empty

The Natural Philosopher wrote:
Quoted text here. Click to load it

I click the submit button represented by the line
<input id="btnVerzenden" name="btnVerzenden" type="submit" value="Verzenden"

and the page is reloaded. I assume that is a postback.

I found a configuration setting "register_globals", turned it on like so:
register_globals = On

Still no difference.

Re: $_POST always empty

Martin Maat schreef:
Quoted text here. Click to load it

(from: http://www.asp.net/Downloads/archived/cassini /)
The ASP.NET Cassini Web Server Sample is a sample web server written
using the Microsoft« .NET« Framework, and demonstrates hosting ASP.NET
using the ASP.NET hosting APIs (System.Web.Hosting).

Cassini is meant for demonstrating use of ASP.NET hosting, not to server
PHP pages....

Try installing a real webserver (Apache, or thttpd)


Site Timeline