Hello friends!
Could somebody help me with this...
I am using IIS 5.1 on win xp (sp2) machine with php 5.2.1.
While using $_POST array to pass values between normal html pages, no variables are passed i.e $_POST array is always blank.
However $_GET works. I was using php 5.2.1. I Tested a few different methods to get the values and on a few different codes.
However it did not help. I downloaded php 4.4.6, that too showed up the same problem. It seems that no variables are passed
using $_POST, while $_GET is working fine. I checked the resource and file upload settings in the php.ini file, they seemed
to be fine. Tried to print_r($_POST) and print_r($_GET) to print the arrays.
print_r($_POST) prints :Array ()
print_r($_GET) prints :Array ( [firstname] => ervin [LastName] => dorsan [email] => ervin@dorsan.com ) ie. data passed..
Do i need to download and try a different version of php, if yes, where could i get it?
Please do suggest any other methods to fix this?
Mohit Valecha
Please reply to : mohit.valecha@gmail.com
$_GET works, while $_POST does not
Moderator: General Moderators
in your html form, do your fields have a name attribute
i.e.
If not then that is your problem
i.e.
Code: Select all
<input type="text" name="myfield">
Read this first.
http://www.php.net/manual/en/tutorial.forms.php
Show sample code you have tried if still have problems.
http://www.php.net/manual/en/tutorial.forms.php
Show sample code you have tried if still have problems.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Show the form method.
It should look like this...
It should look like this...
Code: Select all
<form action="somepage.php" method="post">- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm