Web Hosting Deals Holiday Logo Design Webcam Chat Website Header Templates Register domain Search Engine Optimisation Web Hosting
Go Back   Talk Mania Forum > Programming / Scripting / Coding

Programming / Scripting / Coding Got a question about : PHP / Perl / Java / JavaScript / CGI Scripts / JavaScript coding. Ask here! We'll get you the answers !

 Image
Buy Sell Downloads

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-20-2007, 03:16 PM
bex bex is offline
Junior Member
 
Join Date: Apr 2007
Posts: 7
bex is on a distinguished road
Exclamation formmail in php

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:

Code:
<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:      
        &pound;
        <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 &pound;:
        <label>
        <input name="_pvalue" type="text" id="_pvalue">
        </label>
</p>
      <p class="style1">Mortgage Balance &pound;:
        <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">&nbsp;</p>
      <p class="style1">	
        <label></label>
      </p>
    </form>
and here is my php:

Code:
<?
  $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" );
?>
hope someone can help. Thanks in advance guys

__________________
Finance Forums UK
Secured Loans UK
Reply With Quote
  #2 (permalink)  
Old 04-20-2007, 04:00 PM
Base's Avatar
Senior Member
 
Join Date: Mar 2007
Location: North Yorkshire, UK
Posts: 121
Base is on a distinguished road
Send a message via MSN to Base Send a message via Skype™ to Base
Hi there, no idea about the posting problem, when i went to your website tho, i got a PARSING error..

PHP Code:
 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" ); 
I belive (and do forgive me if i am wrong) you will need to quote your text.

Would be easier if you placed it onto a variable:

PHP Code:
<?php
/* Contact script modified for sexy bexy by Base of PHUK replaced: $_REQUEST with $_POST, took out the parsing error in the mail function.

Good luck and have fun!

Base */
  
$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'] ;
  
$message "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"
;


  
mail"bex4321@hotmail.com""New Application from AinsworthFinance.co.uk!","$message" "From: $email" );
  echo 
'<META HTTP-EQUIV="Refresh"
      CONTENT="0; URL=http://www.ainsworthfinance.co.uk/loans/sent.html">'
;

?>
could be very much mistaken but that should work


__________________________________________________ _____________________

Find my reply usefull? Click the little green tick next to this text to + my reputation!
__________________
http://www.pointserv.co.uk/gfx/deal_..._pointserv.png
PointServ.co.uk - One of the UK's cheapest webhosting companies.
Reply With Quote
  #3 (permalink)  
Old 04-20-2007, 05:47 PM
bex bex is offline
Junior Member
 
Join Date: Apr 2007
Posts: 7
bex is on a distinguished road
thanks ive got it working now
__________________
Finance Forums UK
Secured Loans UK
Reply With Quote
  #4 (permalink)  
Old 04-21-2007, 03:29 AM
Base's Avatar
Senior Member
 
Join Date: Mar 2007
Location: North Yorkshire, UK
Posts: 121
Base is on a distinguished road
Send a message via MSN to Base Send a message via Skype™ to Base
gdgd

Glad i could help ya!

Base

__________________
http://www.pointserv.co.uk/gfx/deal_..._pointserv.png
PointServ.co.uk - One of the UK's cheapest webhosting companies.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +2. The time now is 06:59 PM.


Fake ID

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC8
Forums Copyright © Talk-Mania.com