File not found when using PHP [closed]

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

Answer

<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.

Attribution
Source : Link , Question Author : user2945923 , Answer Author : ceejayoz

Leave a Comment