-5

Problem:

PHP is not working right. My html file asks for a name and then calls the PHP will display a "Hello" message.

What is happening is on the htm page I am putting in my name and hit go then the browser shows website/Drop2.php and I get 404 error saying page not found. It is like the htm page is not really getting to the PHP file.

Environment:

  • Software loaded and verified
  • Win Server 2003
  • IIS 6.0
  • PHP 5.4
  • VC9 x86
  • FastCGI
  • WinCache 1.3
  • Visual C++ Redistributable files for X86

PHP has been tested and works from command prompt All FastCGI changes have been made per documentation

My configuration looks like this

  • c:\Inetpub\wwwroot htm and php file
  • c:\Inetpub\wwwroot\PHP PHP software

I have installed all the above software, set up the following:

  1. Extension .php c:\Intepub\wwwroot\PHP\ext\php5isapi.dll
  2. Added index.php to my doucments in IIS
  3. Added to php.ini both and extension_dir=c:\Inetpub\wwwroot\PHP\ext and extension=php_wincache.dll
  4. Added Web service Extension for PHP ISAPI
  5. Added to Path - c:\Inetpub\wwwroot\PHP

Here is htm code for Drop2.htm:

<html>
<head>
<Title>Form</Title>
</head>
<body>
<h1>Enter your name</h1>
<form method="post" action="C:\Inetpub\wwwroot\Drop2.php">
<input type="text" name="me">
<input type="submit">
</form>
</body>
</html>

here is PHP code for Drop2.php:
<html>
<head>
<title>Form</title>
</head>
<body>
<?php
echo "<h1>Hello " . $_POST["me"] . "</h1>";
?>
</body>
</html>

If you want to run live on my server try. www.sloventhal.com and click on 3 to execute this code

closed as off-topic by Ward, mdpc, MadHatter, Jim B, HBruijn Jul 12 '15 at 7:34

This question appears to be off-topic. The users who voted to close gave these specific reasons:

If this question can be reworded to fit the rules in the help center, please edit the question.

5
<form method="post" action="C:\Inetpub\wwwroot\Drop2.php">

C:\ is not a URL, it's a path.

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

would be better, assuming the files are in the same folder.

  • 1
    Also, on the live example, you're linking to localhost which is wrong. – Michael Bailey Jul 9 '15 at 18:02
  • I changed it to what you said. Both htm and php are in the same directory but still get the 404? – user2945923 Jul 9 '15 at 18:10
  • 1
    @user2945923 I know it's .htm. However, the fact that the .html and the .php URLs both have 404 errors but different 404 errors is interesting to me. – ceejayoz Jul 9 '15 at 18:29
  • 1
    @user2945923 Have you considered starting on a hosted server somewhere? My guess is you've got something wrong with the configuration, not the PHP code itself. Running a server is a big bite to chew when you're just trying to learn a language. Even something like XAMPP would probably be much better. – ceejayoz Jul 9 '15 at 18:49
  • 1
    It's gotta be a config issue. The code runs fine. – Michael Bailey Jul 9 '15 at 18:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.