maluch Posted June 11, 2007 Share Posted June 11, 2007 hello, I'm sure this question was asked before, but I was unable to find a similar thread. I'm using 1and1.com to host my site and can't get my form to work. Everything seems to be right but upon hitting the submit button I get a http 405 error(invalid verb, http method). I had my friends(comp sci majors) review the code, but they could find nothing wrong. I found something on google that indicates a permission problem. Any thoughts? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/55161-need-help-with-form/ Share on other sites More sharing options...
B34ST Posted June 11, 2007 Share Posted June 11, 2007 could you post some code? Quote Link to comment https://forums.phpfreaks.com/topic/55161-need-help-with-form/#findComment-272669 Share on other sites More sharing options...
maluch Posted June 11, 2007 Author Share Posted June 11, 2007 form http: <td><form action="email.php" method="post" name="form1" target="_parent" id="form1"> <div align="right"> <table width="611" border="0"> <tr> <td width="161"> </td> <td width="440"><span class="style35">**Note: <span class="style33">All information optional, but some required for contact.</span></span></td> </tr> </table> <br /> <p>Name: <input name="name" type="text" id="name" size="60" /> <br /> <br /> Email<span class="style23">**</span>: <input name="email" type="text" id="email" size="60" /> <br /> <br /> Phone Number<span class="style23">**</span>: <input name="phone" type="text" id="phone" size="60" /> <br /> <br /> How did you become aware of JanPol? <input name="reference" type="text" id="reference" size="60" /> <br /> <br /> Job Description/Comments: <textarea name="comments" cols="57" rows="10" id="comments"></textarea> <br /> <br /> <br /> </p> </div> <table width="661" border="0"> <tr> <td width="274" height="26"> </td> <td width="298"><input type="submit" name="Submit" value="SUBMIT" /></td> <td width="75"><label> <input name="Reset" type="reset" id="Reset" value="reset" /> </label></td> </tr> </table> </form> php code: <?php $to= "service@janpol.org"; // Your email address goes here. $subject= "Email z Janpol.org strony internetowej"; $body= "Email zostal wyslany przez " . $_REQUEST['name'] . " Tej osoby adres emailowy: " . $_REQUEST['email'] . " <br /> Tej osoby numer telefonu: " . $_REQUEST['phone'] . " <br /> Ta osoba dowiedziala sie o JanPol z: " . $_REQUEST['reference'] . " <br /> Email zostal wyslany: " . date("F j, Y, g:i a") . "<br /> <br /><br />" . $_REQUEST['comments']; if (mail($to, $subject, $body)) // mail() is a boolean function { echo("<p>Message successfully sent!</p>"); sleep(3); header("Location: contact.html"); } else { echo("<p>Message delivery failed...Please make sure all the information that you have provided is valid.</p>"); sleep(3); header("Location: contact.html"); } ?> Maybe I could use chmod to change the permission settings? Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/55161-need-help-with-form/#findComment-272670 Share on other sites More sharing options...
B34ST Posted June 11, 2007 Share Posted June 11, 2007 I noticed u are using $_reguest rather than $_post try the following: <?php $to= "service@janpol.org"; // Your email address goes here. $subject= "Email z Janpol.org strony internetowej"; $body= "Email zostal wyslany przez " . $_POST['name'] . " Tej osoby adres emailowy: " . $_POST['email'] . " Tej osoby numer telefonu: " . $_POST['phone'] . " Ta osoba dowiedziala sie o JanPol z: " . $_POST['reference'] . " Email zostal wyslany: " . date("F j, Y, g:i a") . " " . $_POST['comments']; if (mail($to, $subject, $body)) // mail() is a boolean function { echo("<p>Message successfully sent!</p>"); sleep(3); header("Location: contact.html"); } else { echo("<p>Message delivery failed...Please make sure all the information that you have provided is valid.</p>"); sleep(3); header("Location: contact.html"); } ?> I did not check the rest of your code Quote Link to comment https://forums.phpfreaks.com/topic/55161-need-help-with-form/#findComment-272673 Share on other sites More sharing options...
maluch Posted June 11, 2007 Author Share Posted June 11, 2007 I tried that too. I actually switched it to request after post was not working. thanks tho. Quote Link to comment https://forums.phpfreaks.com/topic/55161-need-help-with-form/#findComment-272692 Share on other sites More sharing options...
maluch Posted June 11, 2007 Author Share Posted June 11, 2007 can someone tell me how to use the chmod function to set permission to 0755? what is the file path, is that the hosting server path and can i get that path with some function? Quote Link to comment https://forums.phpfreaks.com/topic/55161-need-help-with-form/#findComment-272706 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.