buddyboy270 Posted October 19, 2009 Share Posted October 19, 2009 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 More sharing options...
simshaun Posted October 19, 2009 Share Posted October 19, 2009 What is the form HTML? Link to comment https://forums.phpfreaks.com/topic/178248-post-not-working-plz-help/#findComment-939821 Share on other sites More sharing options...
Kaboom Posted October 19, 2009 Share Posted October 19, 2009 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 Link to comment https://forums.phpfreaks.com/topic/178248-post-not-working-plz-help/#findComment-939822 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.