Page 1 of 1

New PHP/Apache install, GETS work, POSTS don't

Posted: Tue Dec 15, 2009 12:52 pm
by scrumley
Details:
Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.2 with Suhosin-Patch Phusion_Passenger/2.2.5

I can retrieve data when I GET a from, but not when I POST. I turned Global Variables on just to test and still couldn't get data POST. Is there another config that needs changed?

Re: New PHP/Apache install, GETS work, POSTS don't

Posted: Tue Dec 15, 2009 1:23 pm
by AbraCadaver
scrumley wrote:Details:
Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.2 with Suhosin-Patch Phusion_Passenger/2.2.5

I can retrieve data when I GET a from, but not when I POST. I turned Global Variables on just to test and still couldn't get data POST. Is there another config that needs changed?
Please post the code that is not working.

Re: New PHP/Apache install, GETS work, POSTS don't

Posted: Tue Dec 15, 2009 1:29 pm
by scrumley
I tried a sample off the php site... Nothing dispays.

Here is the form page:
<form action="foo.php" method="post">
Name: <input type="text" name="username" /><br />
Email: <input type="text" name="email" /><br />
<input type="submit" name="submit" value="Submit me!" />
</form>

Here is foo.php

<?php
// Available since PHP 4.1.0

echo $_POST['username'];
echo $_REQUEST['username'];

import_request_variables('p', 'p_');
echo $p_username;

// Unavailable since PHP 6. As of PHP 5.0.0, these long predefined
// variables can be disabled with the register_long_arrays directive.

echo $HTTP_POST_VARS['username'];

// Available if the PHP directive register_globals = on. As of
// PHP 4.2.0 the default value of register_globals = off.
// Using/relying on this method is not preferred.

echo $username;
?>

Re: New PHP/Apache install, GETS work, POSTS don't

Posted: Tue Dec 15, 2009 3:25 pm
by AbraCadaver
What do you get if you add this to foo.php:

Code: Select all

error_reporting(E_ALL);
ini_set('display_errors', '1');
echo "NO PARSE ERRORS HERE";