Jump to content

Post, not working, plz help


buddyboy270

Recommended Posts

The error is:

Method Not Allowed

The requested method POST is not allowed for the URL /students/06/php/index.

 

 

--------------------------------------------------------------------------------

 

Apache/1.3.33 Server at www.mesickonline.com Port 80

 

My code is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

</head>

 

<body>

<?

$truck=$_POST["bowser"];

if ($truck= "ford")

    echo("hello peeps");

elseif ($truck= "chevy")

    echo("don't drive chevys");

elseif ($truck= "dodge")

    echo("get a real truck");

else

    echo("type in your favorite vehical brand");

    $bowser=fopen('index.html','a');

fwrite($bowser,$truck);

?>

<html>

<body>

</body>

</html>

</body>

</html>

 

Link to comment
https://forums.phpfreaks.com/topic/178248-post-not-working-plz-help/
Share on other sites

Hmm .... Well.. try this and see?

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<form action="index.php" method="post">
<label>Truck Type: <input class='textbox' type="text" name="truck" id="truck" value="Enter a truck and hit enter" /></label>
</form>
<?php
               $truck=$_POST["bowser"];
               if ($truck= "ford")
                              echo("hello peeps");
               elseif ($truck= "chevy")
                              echo("don't drive chevys");
               elseif ($truck= "dodge")
                              echo("get a real truck");
               else
                              echo("type in your favorite vehical brand");
               $bowser=fopen('index.html','a');
               fwrite($bowser,$truck);
?>
</body></html>

Just off top of my head, let me know :D

Archived

This topic is now archived and is closed to further replies.

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