0

I am facing this error. The path of my file is "www/new/filename.html". What is the cause of error. Is the error is because of wrong code or due to configuration issue? I am trying to print the details of form on same file but i am getting error.

<html>
<body>
<?php
$name="";
$ne="";
if($_SERVER["$_REQUEST_METHOD"]=="POST")
{
  $name=$_POST["nam"];
  if(empty($name))
  {
    $ne="Error"
  }
}


?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Name: <input type="text" name="nam"><?php echo $ne;?>
Gender<input type="radio" name="gen" value="male">Male
<input type="radio" name="gen" value="female">female
<input type="submit" name="submit" value="Submit">
</form>
 <?php
  echo "<h1> Inputs </h1>";
  echo "$name";
  ?>
 </body>
 </html>
Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
siva s
  • 21
  • 4
  • 1
    Why there is `.html` extension? It should be `.php`. – Tirth Patel Jun 04 '16 at 21:31
  • 1
    It's a server (Apache) issue - totally unrelated to any code you have here. See similar issues here: http://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server – HPierce Jun 05 '16 at 00:27
  • I am using WAMP on windows system – siva s Jun 05 '16 at 08:56

1 Answers1

-1

Issue a sestatus to check if you have selinux enabled or not. Check web server logs as well to see if you get more details about the forbidden error

Bogdan Stoica
  • 4,349
  • 2
  • 23
  • 38