Page 1 of 1

Page refreshing on submit and notgoing to next ..any ideas?

Posted: Wed Mar 10, 2010 1:16 pm
by scorpio90
hi guys,

i really need somehelp on this one, i have created a form online and when i hit the submit button at the bottom of the page the form just refreshes and doesnt go to the next page that i specified in the action=insert.php ... i will post the code below please help me if you can i need this done by tomorrow :D... thankyou in advance. BTW its quite big coding :D

this is the index page.

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>USA Buy Back investment</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="def.css" rel="stylesheet" type="text/css" media="screen"/>
</head>
<body>
<div id="content">
  <div id="left">
    <h1 class="text1">Reservation Form.<br />
      <span class="text2"></span></h1>
        <?php include "men.php";?>
    <div id="footer">
      <p>Copyright &copy; Right Buy Properties LLC.</p>
    </div>
  </div>
  <div id="menu">
    <div class="">
  </div>
  <div id="right">
    
  <form>
  <p><b><font color="f30505" >Please complete carefully and return to Right Buy Properties LLC.</font></b></p>
  
      <p><b><font color="f30505" >Please complete, print, scan and email to  buyback@rightbutproperties.co.uk.</font></b></p>
      <p><h1>PROPERTY DETAILS </h1>           
<tr><td><b>Investment: USA "Buy-Back" Investment </b> </td><p>&nbsp;</p><td><b>Date: </b> </td><td><input type="text" value="" name="date" size=15> </td>&nbsp;<td><b>Number Of Investments:</b> </td><td><input type="text" value="" name="number_of_investments" size=15></td></tr>
<p>&nbsp;</p>
<P><b> Cost per investment: £26,000 each</b> &nbsp;&nbsp;&nbsp; <p>*Reservation Fee: £1,000</p>
                                                                <p>*1st Scheduled payment of £12,500 property selection </p>
                                                                <p>*2nd Scheduled payment of £12,500 within 7 days of 1st Payment
 
 </p>;
  <form name="fa"  action="insert.php"  method="post">
     <table>                                                           
<h1>PURCHASER(S) INFOMATION</h1>
 
<tr><td width="114"><b>Title: </b> </td><td width="114"><input type="text" value="" name="title" size=10></td>&nbsp;&nbsp;<td><b>Title: </b> </td><td><input type="text" value="" name="title" size=10></td></tr>
 
<tr><td><b>First Name(s): </b> </td><td><input type="text" value="" name="first_name" size=30></td>&nbsp;&nbsp;<td><b>First Name(s): </b> </td><td><input type="text" value="" name="first_name" size=30></td></tr>
 
<tr><td><b>Surname: </b> </td><td><input type="text" value="" name="last_name" size=30></td>&nbsp;&nbsp;<td><b>Surname: </b> </td><td><input type="text" value="" name="last_name" size=30></td></tr>
 
<tr><td><b>Date Of Birth: </b> </td><td><input type="text" value="" name="date_of_birth" size=15></td>&nbsp;&nbsp;<td><b>Date Of Birth: </b> </td><td><input type="text" value="" name="date_of_birth" size=15></td></tr>
 
<tr><td><b>Marital Status: </b> </td><td><input type="text" value="" name="marital_status" size=25></td>&nbsp;&nbsp;<td><b>Marital Status: </b> </td><td><input type="text" value="" name="marital_status" size=25></td></tr>
 
<tr><td><b>Driving Licence No.: </b> </td><td><input type="text" value="" name="licence_number" size=25></td>&nbsp;&nbsp;<td><b>Driving Licence No.: </b> </td><td><input type="text" value="" name="licence_number" size=25></td></tr>
 
<tr><td><b>Issuing Country: </b> </td><td><input type="text" value="" name="issuing_country" size=20></td>&nbsp;&nbsp;<td><b>Issuing Country: </b> </td><td><input type="text" value="" name="issuing_country" size=20></td></tr>
 
</table>
 
<p>&nbsp;</p>
<table>
<tr><td><b>Email: </b> </td><td><input type="text" value="" name="email" size=15></td></tr>
<tr><td><b>Telephone (Landline): </b> </td><td><input type="text" value="" name="tel_home/work" size=15><b>Home/Work</b><select name="Home/Work">
    <option value=" "> </option>
    <option value="Home">Home</option>
    <option value="Work">Work</option>
  </select></td></tr>
<tr><td><b>Telephone (Mobile): </b> </td><td><input type="text" value="" name="mobile_tel" size=15></td></tr>
<tr><td><b>Town: </b> </td><td><input type="text" value="" name="town" size=15></td></tr>
<tr><td><b>Country: </b> </td><td><input type="text" value="" name="country" size=15></td></tr>
<tr><td><b>Post Code: </b> </td><td><input type="text" value="" name="post_code" size=15></td></tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1> PURCHASER(S) AGREEMENT</h1>
<p>We have completed my/our own due diligence on the above property(ies) and have not taken advice from Right Buy Properties LLC in deciding to make this purchase. I/We understand that the initial fee of £1,000 is fully refundable should Right Buy Properties LLC fail to source a suitable property within 30 days of reservation. I/We understand that £12,500 is payable on selection of My/Our investment property and the final payment of £12,500 within seven days from that date. Failure to pay this remaining balance will result in a delay in allocation of a Detroit property. I/We understand that Right Buy Properties LLC are not financial advisers and cannot be held liable for any investment decision that I/We make based on the information in this investment pack. I/We understand that Right Buy Properties LLC are underwriting the rental guarantee for 1 year for each property at a net rate of £350 after the deduction of tax and management fees. I/We also understand that Right Buy Properties LLC will guarantee that I receive my first rental payment for each house 12 weeks after the final payment for the purchase. I/We understand that late payments will therefore cause delays in the rental being paid on time and accept full responsibility for this. I/We understand that Right Buy Properties LLC will pay all maintenance costs for the property for 1 year after receiving the title deeds but that I am personally responsible for the insuring of the property. *Subject to foreign currency fluctuations. Right Buy Properties LLC further guarantee to repurchase this property 1 year from the date of passing title to Me/Us as agreed.
 
 
 
<b>By signing below I/We understand and agree to these terms.</b></p> 
<p>&nbsp;</p>
<p>&nbsp;</p>
 
 
<p><b>Signed:........................................... </b></p>
<p><b>Print Name:.......................................................</b></p>
<p><b>Date:..................</b></p>
<p>&nbsp;</p>
<p><b>Signed:........................................... </b></p>
<p><b>Print Name:.......................................................</b></p>
<p><b>Date:..................</b></p>
 
<h1> PAYMENT DETAILS - ALL PAYMENTS ARE HELD IN OUR TRUST ACCOUNT</h1>
<p>&nbsp;</p>
<P> Right buy Properties, HSBC.</P>
<P> Sort Code: <font color="#FF0000"> 40-34-12 </font>  Account Number: <font color="#FF0000"> 61742167</font></P>
<p>&nbsp;</p>
<table> 
<tr><td><b>Office Use: </b> </td></tr>
</table>
<textarea cols=70 rows=10 name="area"></textarea><br /> 
 
 
<input type="button" onClick="window.print()" value="Print"/>
 
<tr><th colspan=2><p><input type="submit"  value="submit"></p></th></tr>
</table>
</form>
    
</div>
</body>
</html>
and this is where i want it to go to (insert.php)

Code: Select all

<?php echo include"connect.php" ;?>
 
<?php
 //CONNECTION TO DATABASE
    // this is processed when the form is submitted
    // back on to this page (POST METHOD)
    if ($_SERVER['REQUEST_METHOD'] == "POST") {
 
        // double-up apostrophes
        $title = $_POST['title'];
        $first_name = $_POST['first_name'];
        $last_name = $_POST['last_name'];
        $date_of_birth = $_POST['date_of_birth'];
        $marital_status = $_POST['marital_status'];
        $licence_number = $_POST['licence_number'];
        $issuing_country = $_POST['issuing_country'];
        $email = $_POST['email'];
        $tel_home/work = $_POST['tel_home/work'];
        $mobile_tel = $_POST['mobile_tel'];
        $town = $_POST['town'];
        $country = $_POST['country'];
        $post_code = $_POST['post_code'];
        $date = $_POST['date'];
        
        $title = $_POST['title1'];
        $first_name = $_POST['first_name1'];
        $last_name = $_POST['last_name1'];
        $date_of_birth = $_POST['date_of_birth1'];
        $marital_status = $_POST['marital_status1'];
        $licence_number = $_POST['licence_number1'];
        $issuing_country = $_POST['issuing_country1'];
        
        
        
        $SQL = " INSERT INTO tbl_buyback (title, first_name, last_name, date_of_birth, marital_status, licence_nnumber, issuing_country, email, tel_home/work, mobile_tel, town, country, post_code, date) VALUES ('$title', '$first_name', '$last_name', '$date_of_birth', '$marital_status', '$licence_number', '$issuing_country', '$email', '$tel_home/work', '$mobile_tel', '$town', '$country', '$post_code', 'date', '$title1', '$first_name1', '$last_name1', '$date_of_birth1', '$marital_status1', '$licence_number1', '$issuing_country1')";
                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                       
        //execute SQL statement
        $result = mysql_db_query($db,$SQL,$cid);
 
        // check for error
        if (!$result) { echo("ERROR: " . mysql_error() . "\n$SQL\n");   }
 
    echo ("<p><b>Thank you, your information has been received</b></p>\n");
        echo ("<p><b>We will contact you in due course with a list of available properties.</b></p>\n");
    
 
    }
 
{?>
<form><input type=button value="Close This Window" onClick="javascript&#058;window.close();"></form>

Re: Page refreshing on submit and notgoing to next ..any ideas?

Posted: Wed Mar 10, 2010 9:19 pm
by jkraft10
On line 23 you have <form>. You should either get rid of it or move line 35 to line 23. I haven't tested it but that should do the trick.

Re: Page refreshing on submit and notgoing to next ..any ideas?

Posted: Thu Mar 11, 2010 2:53 am
by scorpio90
nope didnt work :(

however,when i am hovering over the submit button it says the direction is back to the "index1" which is the page that i am on but i want it to post the pata into the database then go display that it was successfull ... would i have to put a link the submit button eg. "<a href= "insert.php" </a>" ? or isthere another way of doing it ?

thanks :D

Re: Page refreshing on submit and notgoing to next ..any ideas?

Posted: Thu Mar 11, 2010 3:49 am
by scorpio90
i managed to sort out the problem somehow it was because of the css file that i had on the page ... removed it and it seems to be going to to the page i wanted ... the only problem i have now is that i have a parse error whaich i hve posted on a later topic :D
thank you jkraft10 for you post and help :D