Page 1 of 1

$_GET works, while $_POST does not

Posted: Wed Mar 07, 2007 7:40 am
by mohitv
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

Posted: Wed Mar 07, 2007 7:46 am
by anjanesh
Whats your <form> like ?

Posted: Wed Mar 07, 2007 7:46 am
by mikeq
in your html form, do your fields have a name attribute

i.e.

Code: Select all

<input type="text" name="myfield">
If not then that is your problem

Posted: Wed Mar 07, 2007 7:50 am
by jmut
Read this first.

http://www.php.net/manual/en/tutorial.forms.php

Show sample code you have tried if still have problems.

Posted: Wed Mar 07, 2007 12:22 pm
by RobertGonzalez
Show the form method.

It should look like this...

Code: Select all

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

Posted: Wed Mar 07, 2007 12:42 pm
by superdezign
Doesn't sound like there is a form at all.