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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
scrumley
Forum Newbie
Posts: 2
Joined: Tue Dec 15, 2009 12:48 pm

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

Post 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?
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

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

Post 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.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
scrumley
Forum Newbie
Posts: 2
Joined: Tue Dec 15, 2009 12:48 pm

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

Post 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;
?>
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

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

Post 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";
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply