By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Method Not Allowed The requested method POST is not allowed for the URL /rob.html.

P: n/a
Rob
THis is my code. What im trying to accomplish is the user fills out
the form then when they hit submit it displays what the entered on the
samne page but i get this error message when I hit submit

Method Not Allowed The requested method POST is not allowed for the
URL /rob.html.

Here is the code. Any helpis greatly appreciated I cant figure this
out at all i have tried so many different combinations.

<?php

$firstname=$_POST["firstname"];
$lastname=$_POST["lastname"];
$phone=$_POST["phone"];
$mobile=$_POST["mobile"];
$besttimetocall=$_POST["besttimetocall"];
$city=$_POST["city"];
$bizname=$_POST["bizname"];

if (!isset($_POST['submit'])) {
?>

<html>
<head>
<title>Contracter INFO</title>
</head>
<body>
<form action="rob.html" method="post">
First Name:<input type="text" size="30" maxlength="30"
name="firstname"><br>
Last Name:<input type="text" size="30" maxlength="30"
name="lastname"><br>
Phone:<input type="text" size="30" maxlength="30" name="phone"><br>
Mobile:<input type="text" size="30" maxlength="30" name="mobile"><br>
Best Time To Call:<input type="text" size="30" maxlength="30"
name="besttimetocall"><br>
Select your city:<br>
<select name="city">
<option value="Toronto">Toronto</option>
<option value="Markham">Markham</option>
<option value="Barrie">Barrie</option>
</select><br>
buisiness Name:<input type="text" size="30" maxlength="30"
name="bizname"><br>
<input type="submit" value="submit" name="submit">
</form>

<?
echo "Hello, ".$firstname." ".$lastname.".<br>;
echo "We will get back to you at ".$phone.";

}

?>
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rob wrote:
Method Not Allowed The requested method POST is not allowed for the
URL /rob.html.

^^^^^^^^

Maybe that should be rob.php?

Anyway, I think this is a web server configuration detail.
--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!
Jul 17 '05 #2

P: n/a
Rob wrote:
THis is my code. What im trying to accomplish is the user fills out
the form then when they hit submit it displays what the entered on the
samne page but i get this error message when I hit submit <form action="rob.html" method="post">

Most hosts aren't set up with files with .html extensions to be parsed
as php or any other sort of executable. You probably need an extension
like .php or .php4 or something like that. There are ways you can make
the html files parsed, but there's really no need to do that.

Brian
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.