Solved

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

Posted on 2008-06-13
10
1,023 Views
Last Modified: 2013-12-13
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.
0
Comment
Question by:jallenmorris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 17

Accepted Solution

by:
nanharbison earned 200 total points
ID: 21783085
please post your whole form.
0
 
LVL 4

Assisted Solution

by:albuitra
albuitra earned 100 total points
ID: 21783137
Is there anything in php.log ?
0
 
LVL 11

Assisted Solution

by:spoxox
spoxox earned 100 total points
ID: 21783178
[quote]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.[/quote]

POST (or ALL) is entered for the .php extension, right?

[quote]I can use $_GET['data'] to send something to another page from a form.[/quote]
You can send data to a PHP page, right?

PHP works, generally? e.g.
<html><body>
<?php
echo "Hello, world";
?>
</body></html>
0
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

Author Comment

by:jallenmorris
ID: 21783397
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

0
 
LVL 17

Assisted Solution

by:nanharbison
nanharbison earned 200 total points
ID: 21783428
I don't think you mean this: I can get the form to work if I make it method="post'.
you mean GET, right?
0
 

Author Comment

by:jallenmorris
ID: 21783471
Yes, that's what I mean.  I mean I can get the form to work if I make it method="GET"
0
 
LVL 18

Assisted Solution

by:Gary Davis
Gary Davis earned 100 total points
ID: 21783607
The parameters will be sent from the browser to the server in either case. Some verbs can be blocked but GET and POST would not normally be blocked. So what you have to look at is your PHP code and see how you are retreiving the parameters from the collection.

I don't know much (if any) PHP but I do know that in DotNET, you have to request the parameter(s) from the Form if it was POSTed and from the QueryString if it was GETed(?). You don't get the parameters if you look in the wrong place. I assume PHP also has them separated.

Gary Davis
0
 

Author Comment

by:jallenmorris
ID: 21783640
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.
0
 

Author Comment

by:jallenmorris
ID: 21783656
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.
0
 
LVL 10

Expert Comment

by:ray-solomon
ID: 21783670
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.
:-)
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question