Forum Moderators: coopster

Message Too Old, No Replies

$ POST variable not being populated

$_POST, php5

         

patsimon12

4:15 am on Oct 7, 2006 (gmt 0)

10+ Year Member



Hi All,

My host is running php 5.1.4 yet the $_POST global doesn't seem to be being populated with anything from form's being submitted.

Here is my code for the page at <removed>

<?php

echo"inputter is $inputter and post var is ".$_POST["inputter"];

echo"<br/><br/>The following variable are in the \$_POST array<br/>";
print_r($_POST);
echo"<br/><br/>The following variable are in the \$_GET array<br/>";
print_r($_GET);
echo "<br/><br/>The following variables are in the \$HTTP_POST_VARS array<br/>";
print_r($HTTP_POST_VARS);
echo "<br/><br/>The following variables are in the \$_REQUEST array<br/>";
print_r($_REQUEST);
?>

<form action="test.php" method ="post">
<input type ="text" name="inputter">
<input type="submit">
</form>
?>

[edited by: jatar_k at 5:09 pm (utc) on Oct. 7, 2006]
[edit reason] no urls thanks [/edit]

barns101

10:08 am on Oct 7, 2006 (gmt 0)

10+ Year Member



The GET array works.


<form action="test.php" method ="post">
<input type ="text" name="inputter">

Try removing the spaces:


<form action="test.php" method="post">
<input type="text" name="inputter">

(You're not supposed to post your URL ;) )

lmo4103

12:50 pm on Oct 7, 2006 (gmt 0)

10+ Year Member



Dunno, it does work on my system. I just copy and pasted your code.

It prints:
inputter is and post var is fooe

The following variable are in the $_POST array
Array ( [inputter] => fooe )

The following variable are in the $_GET array
Array ( )

The following variables are in the $HTTP_POST_VARS array
Array ( [inputter] => fooe )

The following variables are in the $_REQUEST array
Array ( [inputter] => fooe [PHPSESSID] => dd98c96b7e85a152491e97e7c932b908 )

There must be a different server setting somewhere.

Start looking in the php docs/manual/help under 'predefined variables'. Also <?php phpinfo();?> possibly shed some light.

eelixduppy

10:10 pm on Oct 7, 2006 (gmt 0)



You might want to contact your hosting company about this issue.

coopster

8:12 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, patsimon12.

It might very well be a server setting as mentioned. Check your post_max_size [php.net] and other configuration directives associated with posting forms.


Related Configurations Note:
See also the file_uploads [php.net], upload_max_filesize [php.net], upload_tmp_dir [php.net], post_max_size [php.net] and max_input_time [php.net] directives in
php.ini

Resource:
[php.net...]