Jump to content

The requested method POST is not allowed


ryanT

Recommended Posts

Im getting this error while simply trying to post to a DataBase...

The requested method POST is not allowed for the URL /parent/insert.php.

I can't figure out why.. please help

[code]<html>
<head>
<title>submit form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<?php
if(isset($_POST['add']))
{
$username="XXXXXr";
$password="XXXXX";
$database="XXXXX";

$pfirst=$_POST['parentfirst'];
$plast=$_POST['parentlast'];
$pphone=$_POST['parentphone'];
$pemail=$_POST['parentemail'];
$kfirst=$_POST['kidfirst'];
$kemail=$_POST['kidemail'];
$wish=$_POST['kidwishlist'];
$pi=$_POST['parentinitals'];

mysql_connect("XXX.XXXXX.XXX",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "INSERT INTO contacts VALUES ('','$pfirst','$plast','$pphone','$pemail','$kfirst','$kemail','$wish','$pi')";
mysql_query($query);

mysql_close();
echo "added";
}
else
echo "not added";
{
?>



<form method="post" action="submit.php">
Parent First Name: <input type="text" name="parentfirst"><br>
Parent Last Name: <input type="text" name="parentlast"><br>
Parent Phone: <input type="text" name="parentlast"><br>
Parent Email: <input type="text" name="parentemail"><br>
Kid First Name: <input type="text" name="kidfirst"><br>
Kid E-mail: <input type="text" name="kidemail"><br>
Kid Wish List: <input type="text" name="kidwishlist"><br>
Parent Initals: <input type="text" name="parentinitals"><br>

<input name="add" type="submit" id="add" value="Submit">
</form>

</body>
</html>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.