Hi i'm new to coding and web design but i'm trying to create a application form. Every time I try and use the form i get this: Method Not Allowed The requested method POST is not allowed for the URL /loans/apply.html. Here is my html: <form method="post" action="sendmail.php"> <p class="style2"><u>Loan Details</u> </p> <span class="style1">Loan Type</span>: <label> <select name="_loantype" id="_loantype"> <option>Secured Loan</option> <option>Bridging Loan</option> <option>Commercial Mortgage</option> </select> </label> <p class="style1">Please enter the Loan amount required: £ <input name="_loanamount" type="text" id="_loanamount"> </p> <label></label> <span class="style1">Term Required: <label> <select name="term" id="term"> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>15</option> <option>20</option> <option>25</option> <option>30</option> </select> </label> </span> <p class="style1"> Loan Purpose: <label> <select name="purpose" id="purpose"> <option>Business</option> <option>Consolidation</option> <option>Furniture</option> <option>Holiday</option> <option>Mortgage</option> <option>Home Improvements</option> <option>Property Purchase</option> <option>Remortgage</option> <option>Vehicle Purchase</option> <option>Wedding</option> <option>Other</option> </select> </label> </p> <p class="style1"><u><strong> Applicants Details - First Applicant</strong></u></p> <p class="style1">First Applicants Full Name<strong></strong>: <label> <select name="_title" id="_title"> <option>Mr</option> <option>Mrs</option> <option>Miss</option> <option>Dr</option> </select> </label> <label> <input name="_name1" type="text" id="_name1"> </label> </p> <p class="style1">Date of Birth: <label> <input name="_dob" type="text" id="_dob"> </label> </p> <p class="style1">Full Address (Including Post Code): <label> <textarea name="_address" id="_address"></textarea> <br> <br> Telephone No.: <input name="_tel" type="text" id="_tel"> Mobile: <input name="mobile" type="text" id="mobile"> <br> <br> Email: <input name="_email" type="text" id="_email"> <br> </label> </p> <p class="style1"><u><strong>Applicants Details - Second Applicant (if applicable) </strong></u></p> <p class="style1">First Applicants Full Name<strong></strong>: <label> <select name="_title2" id="_title2"> <option>Mr</option> <option>Mrs</option> <option>Miss</option> <option>Dr</option> </select> </label> <label> <input name="_name2" type="text" id="_name2"> </label> </p> <p class="style1">Date of Birth: <label> <input name="_dob2" type="text" id="_dob2"> </label> </p> <p class="style1">Full Address (Including Post Code): <label> <textarea name="_address2" id="_address2"></textarea> <br> <br> Telephone No.: <input name="tel2" type="text" id="tel2"> Mobile: <input name="mobile2" type="text" id="mobile2"> <br> <br> Email: <input name="email2" type="text" id="email2"> </label> </p> <p class="style2"><u>Property Details</u> </p> <p class="style1">Property Value £: <label> <input name="_pvalue" type="text" id="_pvalue"> </label> </p> <p class="style1">Mortgage Balance £: <label> <input name="_mbal" type="text" id="_mbal"> </label> </p> <p class="style1"> <label> <input name="_checkbox" type="checkbox" id="_checkbox" value="checkbox"> </label> I/We confirm that I accept the <a href="/tc.html">terms and conditions</a></p> <p align="center" class="style1"> <label> <input type="submit" name="Submit" value="Submit"> </label> </p> <p class="style1"> </p> <p class="style1"> <label></label> </p> </form> Code (markup): and here is my php: <? $email = $_REQUEST['_email'] ; $_loantype = $_REQUEST['_loantype'] ; $_loanamount = $_REQUEST['_loanamount'] ; $term = $_REQUEST['term'] ; $purpose = $_REQUEST['purpose'] ; $_title = $_REQUEST['_title'] ; $_name = $_REQUEST['_name'] ; $_dob = $_REQUEST['_dob'] ; $_address = $_REQUEST['_address'] ; $_tel = $_REQUEST['_tel'] ; $mobile = $_REQUEST['mobile'] ; $_email = $_REQUEST['_email'] ; $_title2 = $_REQUEST['_title2'] ; $_name2 = $_REQUEST['_name2'] ; $_dob2 = $_REQUEST['_dob2'] ; $_address2 = $_REQUEST['_address2'] ; $_tel2 = $_REQUEST['_tel2'] ; $mobile2 = $_REQUEST['mobile2'] ; $_email2 = $_REQUEST['_email2'] ; $_pvalue = $_REQUEST['_pvalue'] ; $_checkbox = $_REQUEST['_checkbox'] ; $mbal = $_REQUEST['mbal'] ; mail( "bex4321@hotmail.com", "New Application from AinsworthFinance.co.uk!", Loantype $_loantype Loan amount $_loanamount Term $term Loan Purpose $purpose Applicant 1 Title $_title Name $_name dob $_dob address $_address telephone $_tel mobile $mobile email $_email Applicant 2 Title $_title2 Name $_name2 dob $_dob2 address $_address2 telephone $_tel2 mobile $mobile2 email $_email2 Property Details Property Value $_pvalue Mortgage Balance $mbal TC Accepted $_checkbox, "From: $email" ); header( "Location: http://www.ainsworthfinance.co.uk" ); ?> Code (markup): I hope someone can help. Thanks in advance guys
I still get the error: Method Not Allowed The requested method POST is not allowed for the URL /loans/apply.html.
i searched and found this , might help you : http://vijaymodi.wordpress.com/2007...ested-method-post-is-not-allowed-for-the-url/
Thanks for the help commandos, i seemed to have stoped that 405 error and now got another one... Parse error: syntax error, unexpected T_VARIABLE in /home/freedom/public_html/loans/sendmail.php on line 26 <? $email = $_POST['_email'] ; $loantype = $_POST['loantype'] ; $loanamount = $_POST['loanamount'] ; $term = $_POST['term'] ; $purpose = $_POST['purpose'] ; $title = $_POST['title'] ; $name = $_POST['name'] ; $dob = $_POST['dob'] ; $address = $_POST['address'] ; $tel = $_POST['tel'] ; $mobile = $_POST['mobile'] ; $email = $_POST['email'] ; $title2 = $_POST['title2'] ; $name2 = $_POST['name2'] ; $dob2 = $_POST['dob2'] ; $address2 = $_POST['address2'] ; $tel2 = $_POST['tel2'] ; $mobile2 = $_POST['mobile2'] ; $email2 = $_POST['email2'] ; $pvalue = $_POST['pvalue'] ; $checkbox = $_POST['checkbox'] ; $mbal = $_POST['mbal'] ; mail( "bex4321@hotmail.com", "New Application from AinsworthFinance.co.uk!", Loantype $loantype Loan amount $loanamount Term $term Loan Purpose $purpose Applicant 1 Title $title Name $name dob $dob address $address telephone $tel mobile $mobile email $email Applicant 2 Title $title2 Name $name2 dob $dob2 address $address2 telephone $tel2 mobile $mobile2 email $email2 Property Details Property Value $pvalue Mortgage Balance $mbal TC Accepted $_checkbox, "From: $email" ); header( "Location: http://www.ainsworthfinance.co.uk" ); ?> Code (markup):
i think it will be related to MYSQL injection , someone could enter in the form something not acceptable and it could mess the database , or drop ir or give access that shouldnt be give . more info here : http://en.wikipedia.org/wiki/Code_injection#PHP_Injection http://en.wikipedia.org/wiki/SQL_injection http://en.wikipedia.org/wiki/Code_injection
I'm not sure if u can do this : <? mail( "bex4321@hotmail.com", "New Application from AinsworthFinance.co.uk!", Loantype $loantype Loan amount $loanamount Term $term Loan Purpose $purpose Applicant 1 Title $title Name $name dob $dob address $address telephone $tel mobile $mobile email $email Applicant 2 Title $title2 Name $name2 dob $dob2 address $address2 telephone $tel2 mobile $mobile2 email $email2 Property Details Property Value $pvalue Mortgage Balance $mbal TC Accepted $_checkbox, "From: $email" ); header( "Location: http://www.ainsworthfinance.co.uk" ); ?> PHP: instead do something like : $message="Loantype $loantype <br /> Loan amount $loanamount <br /> Term $term <br /> Loan Purpose $purpose <br /> Applicant 1 <br /> Title $title <br /> // ETC ..... "; // THEN mail( "bex4321@hotmail.com", "New Application from AinsworthFinance.co.uk!",$message, "From: $email" ); header( "Location: http://www.ainsworthfinance.co.uk" ); PHP:
<? $email = $_POST['_email'] ; $message = "loantype $loantype <br /> loanamount $loanamount <br /> term $term <br /> purpose $purpose <br/ > title $title <br /> name $name <br /> dob $dob <br /> address £address <br /> tel $tel <br /> mobile $mobile <br /> email $email <br /> title2 $title2 <br /> name2 $name2 <br /> dob2 $dob2 <br /> address2 £address2 <br /> tel2 $tel2 <br /> mobile2 $mobile2 <br /> email2 $email2 <br /> title2 $title2 <br /> pvalue $pvalue <br /> mbal $mbal <br /> " mail( "bex4321@hotmail.com", "New Application from AinsworthFinance.co.uk!", $message, "From: $email" ); header( "Location: http://www.ainsworthfinance.co.uk" ); ?> PHP: this error... Parse error: syntax error, unexpected T_STRING in /home/freedom/public_html/loans/sendmail.php on line 28