mina Posted November 2, 2005 Share Posted November 2, 2005 I've searched almost every site on the internet and I cant seem to find a PHP form that actually works :S The ones I've tried keep ending up with a 405 Method Not Allowed error :)I dont know how any PHP so I dont know how to correct it.This is the code of the form I'm currently using-<form action="feedback.php" method="post"><table border="0" cellpadding="8" cellspacing="8" summary="feedback form"><tr><td>Name:</td><td><input type="text" name="name" size="25" /></td></tr><tr><td>Email address:</td><td><input type="text" name="email" size="25" /></td></tr><tr><td colspan="2">Comments<br /><textarea rows="15" cols="45" name="comments"></textarea></td></tr><tr><td align="center" colspan="2"><input type="submit" value="Send Feedback" /><br /><a href="http://www.thesitewizard.com/">Powered by thesitewizard.com</a></td></tr></table></form>Link to the form- http://www.freewebs.com/gatecity2/cform.htmlAnd the php file- http://www.freewebs.com/gatecity2/feedback.phpI'm getting the 405 error on the form, if anyone can help me correct the error it would be very appreciated Link to comment Share on other sites More sharing options...
MadPotato Posted November 3, 2005 Share Posted November 3, 2005 are you sure your host suports PHP? Link to comment Share on other sites More sharing options...
jherzog Posted November 3, 2005 Share Posted November 3, 2005 Is it a priority to sumbit your form via the post method? Do you know the difference between post and get (not tring to insult, I am just not sure of your level of php knowledge). Some php servers disable the post method for security reasons. Usually in that case the get method is still allowed. Let me know if you want more details on this option Link to comment Share on other sites More sharing options...
jherzog Posted November 3, 2005 Share Posted November 3, 2005 The post method submits your form info into the next page invisibly to the web user. The get method submits your form info to the next page using the url address. You have proabably seen many pages who's addresss looks like http://www.domain.com?variable=33&name=john&etc=otherstuffAll of the "?variable=33&name=john&etc=otherstuff" stuff on the end of those addresses are form information being passes along automatically by the get method of html forms.So to try this fix, just change the first line of your script to <form action="feedback.php" method="get">You will also have to check your page feedback.php. It may have lines retrieving the form info. Those commends look something like "$variable = $_POST['Comments'];". If that feedback.php page does contain these commands you need to change POST to GET. ($variable = $_GET['Comments'];Let me know if you have additional questions. Link to comment Share on other sites More sharing options...
jherzog Posted November 3, 2005 Share Posted November 3, 2005 Although I have run into this problem and solved it via using the get method verus the post method, I was wondering if anyone else knows how these methods are banned and/or how to change it. Are these settings that can be set in a .htaccesss file or anything like that. Link to comment Share on other sites More sharing options...
mina Posted November 3, 2005 Author Share Posted November 3, 2005 The post method submits your form info into the next page invisibly to the web user. The get method submits your form info to the next page using the url address. You have proabably seen many pages who's addresss looks like http://www.domain.com?variable=33&name=john&etc=otherstuffAll of the "?variable=33&name=john&etc=otherstuff" stuff on the end of those addresses are form information being passes along automatically by the get method of html forms.So to try this fix, just change the first line of your script to <form action="feedback.php" method="get">You will also have to check your page feedback.php. It may have lines retrieving the form info. Those commends look something like "$variable = $_POST['Comments'];". If that feedback.php page does contain these commands you need to change POST to GET. ($variable = $_GET['Comments'];Let me know if you have additional questions.<{POST_SNAPBACK}> Now it sends me to my php page when I press 'Submit' :S Incase the php's been disabled is there any other type of form that submits when you press the button and doesn't ask you to sign in? Link to comment Share on other sites More sharing options...
jherzog Posted November 3, 2005 Share Posted November 3, 2005 The code you posted above does send your form information to a php page called feedback.php.Without more information I don't know what that page is suppose to do with the information. What is the purpose of this script. Are you sending the comments to a database, generating an email? Link to comment Share on other sites More sharing options...
Paim Posted November 4, 2005 Share Posted November 4, 2005 Afaik, Freewebs DOESN'T support PHP, and no, search Google for like 'free web host PHP' or something. Get isn't really good for forms, its more useful for things perhaps user profile pages, where the url is like http://www.blah.com/profiles.php?id=8 or something. Post is more used for forms anyway Link to comment Share on other sites More sharing options...
mina Posted November 11, 2005 Author Share Posted November 11, 2005 Thanks for the help everyone, I'll search for a webhost that supports PHP as soon as I get the time Link to comment Share on other sites More sharing options...
alzable Posted November 19, 2005 Share Posted November 19, 2005 Yep, hope you find one soon :)alzable Link to comment Share on other sites More sharing options...
degsy Posted November 22, 2005 Share Posted November 22, 2005 I would recommend http://34sp.com as a budget host. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now