View previous topic :: View next topic |
Author |
Message |
Trix -
Joined: 03 Apr 2003 Posts: 33
|
Posted: Sat Aug 02, 2003 6:19 pm Post subject: Error 405: Method Not Allowed |
|
|
grrr i keep on getting this error on my first php script im trying to run locally i installed php fine and configured abyss webserver like it says to on the site but it doesnt work! it comes up with error 405 this is the script:
handle_form.php
Code: | <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Form Feedback</title>
</head>
<body>
<?php
# Script 2.5 - handle_form.php
// Check $name and strip any slashes:
if (strlen($name) > 0) {
$name = stripslashes($name);
} else { // If no name was entered...
$name = NULL;
echo '<p><b>You forgot to enter your name!</b></p>';
}
// Check $comments and strip any slashes:
if (strlen($comments) > 0) {
$comments = stripslashes($comments);
} else { // If there are no comments...
$comments = NULL;
echo '<p><b>You forgot to enter your comments!</b></p>';
}
// Check $email:
if ( !(strlen($email) > 0) ) {
$email = NULL;
echo '<p><b>You forgot to enter your email!</b></p>';
}
// Gender...
if (isset($gender)) {
if ($gender == 'M') {
$message = '<b><p>Good day, Sir!</p></b>';
} elseif ($gender == 'F') {
$message = '<b><p>Good day, Madam!</p></b>';
}
} else { // If no gender was selected...
$gender = NULL;
echo '<p><b>You forgot to enter your gender!</b></p>';
}
// If everything was filled out, print the message.
if ($name && $comments && $email && $gender) {
echo "Thank you, <b>$name</b> for the following comments:<br /><tt>$comments</tt><p>We will reply to you at <i>$email</i>.</p>";
echo $message;
}
?>
</body>
</html> |
form.html
Code: | <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>HTML Form</title>
</head>
<body>
<!-- Script 2.1 - form.html -->
<form action="handle_form.php" method="post">
<fieldset><legend>Enter your information in the form below:</legend>
<p><b>Name:</b> <input type="text" name="name" size="20" maxlength="40" /></p>
<p><b>Email Address:</b> <input type="text" name="email" size="40" maxlength="60" /> </p>
<p><b>Gender:</b> <input type="radio" name="gender" value="M" /> Male <input type="radio" name="gender" value="F" /> Female</p>
<p><b>Age:</b>
<select name="age">
<option value="0-13" selected>Under or Exactly 13</option>
<option value="13-20">Betweeen 13 and 20</option>
<option value="20+">Over 20</option>
</select></p>
<p><b>Comments:</b> <textarea name="comments" rows="3" cols="50"></textarea></p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Submit Information" /></div>
</form><!-- End of Form -->
</body>
</html> |
the server can exacute php fine so does anybody know how to let it exacute these files?? the error comes up when u press Submit information thnx for anyhelp |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sun Aug 03, 2003 5:04 pm Post subject: Re: Error 405: Method Not Allowed |
|
|
The error means that the directory where is handle_form.php is not configured as a CGI Path. That's why you got error 405 when a POST request is sent to handle_form.php since it isn't considered as a dynamic page.
Please add the directory where this file is located to the CGI Paths. For example, if its URL is http://yoursite/path/handle_form.php , you should add /form to the CGI Paths table.
If you install PHP as described in http://www.aprelium.com/abyssws/php.html, you won't need this step since / is added to the CGI Paths and this instructs the server to consider any script in any directory as a dynamic page. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
|