Link to home
Start Free TrialLog in
Avatar of jallenmorris
jallenmorris

asked on

POST not working on IIS 5 but GET is working How to get POST to work also.

I have installed PHP5 on IIS on my windows XP machine.  I have MySQL working, phpMyAdmin working also.  In my scripts I cannot get the POST data to send to another page.  I can use $_GET['data'] to send something to another page from a form.

I have method="POST" in my html form,  I have $_POST['data_name'] in my script but it will not show up.

If I do var_dump($_POST),  I get the following display:

array(0) {}

I went to Properties on Default Web Site in my Internet Information, to the Home Directory tab and then "Configuration".  I check to see that the verb POST is entered there and it is.

I can't figure out why this isn't working.

500 points to the person that helps me figure it out.  If more than one person is helpful, I'll ask another similar, but different question to award points to more than one helpful person.
ASKER CERTIFIED SOLUTION
Avatar of nanharbison
nanharbison
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jallenmorris
jallenmorris

ASKER

Here is my whole form:

I am pretty sure the problem is not the form.  I can get the form to work if I make it method="post'.  I think the problem has to be with the way I have php installed.  

Yes.  PHP itself is working just fine.
FORM:
 
<form name="login" method="post" action="jarod.php">
<input type="text" name="user">
<input type="submit" name="submit" value="Submit">
 
The PHP page that processes the form.
<?php
 
print $_POST['user'];
 
?>

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, that's what I mean.  I mean I can get the form to work if I make it method="GET"
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I know the problem is not in my code.  I've been programming PHP for 7 years.  As I said in the post, I installed IIS5 and PHP5 on my Windows XP Pro machine.  I 'm 99% sure that the problem is in my setup of the server.

Is there something in php.ini that I've forgotten to uncomment?  I do not have regsiter_globals on, it is set to Off.
I figured out the problem.  I put my folder into the wwwroot folder on the server.  The settings for the .php extension were not inherited to the subfolder.  I think that it should be, but for some reason it was not.  I created a new virtual directory in IIS pointing it to the subfolder and treating it as it's own separate website rater than a subfolder and the POST works.  Thanks to all that helped out.
No matter how long a person is a programmer, sometimes the simplest things can be the hardest things to see.
It happens to the best of us. Glad you figured it out.
:-)