Jump to content

Recommended Posts

I have been adjusting the form in Dreamweaver and have pretty much got it as I would like it to display on the site.

 

I have made it 700 wide because that is what the google iframe images are and they show up well.

 

Please can you have a look at the enclosed and see what I need to change to get just my green background form to show up?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

<style type='text/css'> 

body{
    margin-left: 18px;
    margin-top: 18px;
}

body{
    font-family : Verdana, Arial, Helvetica, sans-serif;
    font-size : 13px;
    color : #474747;
    background-color: transparent;
}

select, option{
    font-size:13px;
}

ol.phpfmg_form{
    list-style-type:none;
    padding:0px;
    margin:0px;
}

ol.phpfmg_form li{
    margin-bottom:5px;
    clear:both;
    display:block;
    overflow:hidden;
width: 100%
}


.form_field, .form_required{
    font-weight : bold;
}

.form_required{
    color:red;
    margin-right:8px;
}

.field_block_over{
}

.form_submit_block{
    padding-top: 3px;
}

.text_box, .text_area, .text_select {
    width:300px;
}

.text_area{
    height:80px;
}

.form_error_title{
    font-weight: bold;
    color: red;
}

.form_error{
    background-color: #F4F6E5;
    border: 1px dashed #ff0000;
    padding: 10px;
    margin-bottom: 10px;
}

.form_error_highlight{
    background-color: #F4F6E5;
    border-bottom: 1px dashed #ff0000;
}

div.instruction_error{
    color: red;
    font-weight:bold;
}

hr.sectionbreak{
    height:1px;
    color: #ccc;
}

#one_entry_msg{
    background-color: #F4F6E5;
    border: 1px dashed #ff0000;
    padding: 10px;
    margin-bottom: 10px;
}

    



</style>



<div class='form_description'>

</div>



<form name="flying" action='process.php' method='post' enctype='multipart/form-data' onsubmit='return fmgHandler.onsubmit(this);'>
<input type='hidden' name='formmail_submit' value='Y'>
<div id='err_required' class="form_error" style='display:none;'>
    <label class='form_error_title'>Please check the required fields</label>
</div>

            
            
<ol class='phpfmg_form' >

<li class='field_block' id='field_0_div'><div class='col_label'>
<label class='form_field'>id</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="id"    class='text_box'>
<div id='field_0_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_1_div'><div class='col_label'>
<label class='form_field'>status</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="status"   class='text_box'>
<div id='field_1_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_2_div'><div class='col_label'>
<label class='form_field'>username</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="username"  id="field_2" value="" class='text_box'>
<div id='field_2_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_2_div'><div class='col_label'>
<label class='form_field'>Airfield Name</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="airfieldname"   class='text_box'>
<div id='field_2_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_3_div'><div class='col_label'>
<label class='form_field'>Height Above Sea Level</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="heightabovesealevel"   class='text_box'>
<div id='field_3_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_4_div'><div class='col_label'>
<label class='form_field'>General Location</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="field_4" id="generallocation" rows=4 cols=25 class='text_area'></textarea>

<div id='field_4_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_5_div'><div class='col_label'>
<label class='form_field'>Co-ordinates</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="co_ordinates"   class='text_box'>
<div id='field_5_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_6_div'><div class='col_label'>
<label class='form_field'>Prior Permission Required</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<select name='ppr' class='text_select'  >	
<option value="yes" >yes</option>	
<option value="no" >no</option>	
</select>
<div id='field_6_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_7_div'><div class='col_label'>
<label class='form_field'>Alternative Field</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="alternate  id="field_7" value="" class='text_box'>
<div id='field_7_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_8_div'><div class='col_label'>
<label class='form_field'>Air Ground Radio</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<select name='airground' class='text_select'width = 20pt>	
<option value="Yes" >Yes</option>	
<option value="No" >No</option>	
</select>
<div id='field_8_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_9_div'><div class='col_label'>
<label class='form_field'>Radio Frequency</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="radiofrequency"   class='text_box'>
<div id='field_9_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_10_div'><div class='col_label'>
<label class='form_field'>Runways</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="runways"  rows=4 cols=25 class='text_area'></textarea>

<div id='field_10_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_11_div'><div class='col_label'>
<label class='form_field'>Circuits</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="circuits"  rows=4 cols=25 class='text_area'></textarea>

<div id='field_11_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_12_div'><div class='col_label'>
<label class='form_field'>Remarks</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="remarks"  rows=4 cols=25 class='text_area'></textarea>

<div id='field_12_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_13_div'><div class='col_label'>
<label class='form_field'>Warnings</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="field_13" id="field_13" rows=4 cols=25 class='text_area'></textarea>

<div id='field_13_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_14_div'><div class='col_label'>
<label class='form_field'>Operating Hours</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="ophours"   value="" class='text_box'>
<div id='field_14_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_15_div'><div class='col_label'>
<label class='form_field'>Contacts</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="contacts"  rows=4 cols=25 class='text_area'></textarea>

<div id='field_15_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_16_div'><div class='col_label'>
<label class='form_field'>Landing Fee</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="landingfee"  id="field_16" value="" class='text_box'>
<div id='field_16_tip' class='instruction'></div>
</div>
</li>
<br><input type="submit" value="Submit">            


</form>



<p> </p>
<table width="700" border="0" cellspacing="0" cellpadding="10">
  
   <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"> </td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"> </td>
    <td align="left" valign="top" bgcolor="#D6FFDC"> </td>
  
  
  
  
  
  
  <tr>
    <td width="100" bgcolor="#D6FFDC"> </td>
    <td width="200" align="right" valign="top" bgcolor="#D6FFDC"><strong>I.D. </strong></td>
    <td width="200" align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="id"    class='text_box'>
    </strong></td>
    <td width="200" align="left" valign="top" bgcolor="#D6FFDC"><strong>Should this field be hidden?</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Status </strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="status"   class='text_box'>
    </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Should this be hidden?</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Username</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="airfieldname"   class='text_box'>
    </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Your Name</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Airfield Name</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="airfieldname"   class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Known as</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Height Above QNH</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="heightabovesealevel"   class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>In Feet</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><p><strong>General Location</strong></p>
    <p> </p></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="field_4" id="generallocation" rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>I.E. 2nm North West of Newcastle</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>CoOrdinates</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="co_ordinates"   class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Degrees Minutes Seconds</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>PPR?</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <select name='ppr' class='text_select'  >	
        <option value="yes" >yes</option>	
        <option value="no" >no</option>	
      </select>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Yes / No</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Alternative Airfield</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="alternate  id="field_7" value="" class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Alternative for Microlights</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Air Ground Radio</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <select name='airground' class='text_select'width = 20pt>	
        <option value="Yes" >Yes</option>	
        <option value="No" >No</option>	
      </select>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Yes / No</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Radio Frequency</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="radiofrequency"   class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>A/G or Safetycom</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Runways</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="runways"  rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><p><strong>E.G. <br />
      06-24<br />
      18-36
      <br />
    </strong></p></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Circuits</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="circuits"  rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>E.G. <br />
    06-LH<br />
    24-RH      <br />
    </strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Remarks</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="remarks"  rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>E.G. Airfield under 28 day rule etc.</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Warnings</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="field_13" id="field_13" rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>E.G. Don't fly over local vilages etc.</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Operating Hrs</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="ophours"   value="" class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>SR-SS or time.</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Contacts</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="contacts"  rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Contacts with as much info as possible, including web address if possible.</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><strong>Landing Fee</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="landingfee"  id="field_16" value="" class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>£ for Microlights</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><input type="submit" value="Submit"> </td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"> </td>
    <td align="left" valign="top" bgcolor="#D6FFDC"> </td>
  </tr>
</table>



</body>
</html>

 

Hi nomadsoul.

 

I have put this form together.  It's been driving my eyes crazy. 

 

I think it's coming together.  You will probably tell me something different.  I've also added a couple of fields to the DB.  I've added runway surface (grass tarmac etc) and the google Iframe for the map.  I've made that one 700 characters long because the one I tested was 450 characters long so thought I would give it some room.  Here is the code from the input form. Please could you take a look at it.

 

I have added the code for the form_response.php further down.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

<form method ="post" action="form_response.php">

<p> </p>
<table width="700" border="0" cellspacing="0" cellpadding="10">
  
   <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"> </td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"> </td>
    <td align="left" valign="top" bgcolor="#D6FFDC"> </td>
  
  
  
  
  
  
  <tr>
    <td width="100" bgcolor="#D6FFDC"> </td>
    <td width="200" align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>I.D.</strong> </td>
    <td width="200" align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input name="id" type="int">
    </strong></td>
    <td width="200" align="left" valign="top" bgcolor="#D6FFDC"><strong>Should this field be hidden?</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Status</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="varchar" name="status"   class='text_box'>
    </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Should this be hidden?</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Username</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="varchar" name="name"   class='text_box'>
    </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Your Name</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Airfield Name</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="airfieldname"   class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Known as</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Height Above QNH</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="int" name="heightabovesl"   class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>In Feet</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><p><div class="form_element_div"><strong>General Location</strong></p>
    <p> </p></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
     <input type="varchar" name="generallocation" rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>I.E. 2nm North West of Newcastle</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>CoOrdinates</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="varchar" name="co_ords"   class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Degrees Minutes Seconds</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>PPR?</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <select name='priorpermission' class='text_select'  >	
        <option value="yes" >yes</option>	
        <option value="no" >no</option>	
      </select>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Yes / No</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Alternative Airfield</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="alternatefield" class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Alternative for Microlights</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Air Ground Radio</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <select name='airground' class='text_select'width = 20pt>	
        <option value="Yes" >Yes</option>	
        <option value="No" >No</option>	
      </select>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Yes / No</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Radio Frequency</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="radiofrequency"   class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>A/G or Safetycom</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Runways & Length</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="runways"  rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><p><strong>E.G. <br />
      06-24 - 560m<br />
      18-36
      - 400m<br />
    </strong></p></td>
  </tr>
  
   <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Runway Surface</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="surface"   class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>E.G. Grass / Tarmac </strong></td>
  </tr>
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Circuits</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="circuits"  rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>E.G. <br />
    06-LH<br />
    24-RH      <br />
    </strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Remarks</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="remarks"  rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>E.G. Airfield under 28 day rule etc.</strong></td>
  </tr>
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Warnings</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="field_13" id="field_13" rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>E.G. Don't fly over local vilages etc.</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Operating Hrs</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="ophours"   value="" class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>SR-SS or time.</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Contacts</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="contacts"  rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>Contacts with as much info as possible, including web address if possible.</strong></td>
  </tr>
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Landing Fee</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <input type="text" name="landingfee"  id="field_16" value="" class='text_box'>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>£ for Microlights</strong></td>
  </tr>
  
  
  
  <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><div class="form_element_div"><strong>Google Iframe Code</strong></td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"><strong>
      <textarea name="google_iframe"  rows=4 cols=25 class='text_area'></textarea>
     </strong></td>
    <td align="left" valign="top" bgcolor="#D6FFDC"><strong>700px X 700px Google Iframe Code</strong></td>
  </tr>
  
   <tr>
    <td bgcolor="#D6FFDC"> </td>
    <td align="right" valign="top" bgcolor="#D6FFDC"><input type="submit" value="Submit"> </td>
    <td align="left" valign="middle" bgcolor="#D6FFDC"> </td>
    <td align="left" valign="top" bgcolor="#D6FFDC"> </td>
  </tr>
  
</table>

</body>
</html>

 

I have also put the form_response.php together with some test fields to see if I return an output.  They all do except the following fields and I can't for the life of me see what I've done differently, and I'm getting tired now because it's getting late.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Form Response</title>
</head>

<body>
<?php 

// Form Processing Code

print "ID: {$_POST[id]}";
?>

<br>
<?php

print "I.D.: {$_POST[id]}";
print "Your Name: {$_POST[name]}"; 
print "Airfield Name: {$_POST[airfieldname]}"; 
print "Height Above QNH: {$_POST[heightabovesl]}"; 
print "General Location: {$_POST[generallocation]}"; 
print "Co-Ordinates: {$_POST[co_ords]}"; 
print "Prior Permission: {$_POST[priorpermission]}";
print "Alternate Airfield: {$_POST[alternatefield]}";
print "Air Ground Radio: {$_POST[airground]}";
print "Radio Frequency: {$_POST[radiofrequency]}";
print "Runways: {$_POST[runways]}";
print "Surface: {$_POST[surface]}";
print "Circuits: {$_POST[circuits]}";
print "Remarks: {$_POST[remarks]}";
print "Warnings: {$_POST[warnings]}";
print "Operating Hours: {$_POST[ophours]}";
print "Contact Details: {$_POST[contactdetails]}";
print "Landing Fee: {$_POST[landingfee]}";
print "Google Iframe: {$_POST[google_iframe]}";
print "Status: {$_POST[approved]}";





?> 
</body>
</html>

 

 

Ok,  I'm going to make a process page  that will process the data into the database.  Check back in a few hours.

I wouldn't worry about how things look yet.  The most important is to get it working first.

I've taken an old insert script of mine and altered it to suit your form.

It is connecting but not inserting.  Right now I don't have time to debug it or create any conditionals for insert or error check so, I'm hoping someone else can check it, modify or alter it, i won't object

I've also included the table information.  I should have copied the CREATE TABLE statement when I had the chance but didn't. Sorry.

I'll check back  in a day or so. I'm busy but not for too long. 

 

So, below are 3 files to work with, and make sure they are in separate files in the same folder:

connect.php  -you'll need to modify for your host, password etc..

process.php  -the insert script which is linked to connect.php

form.htm    -your form slightly edited

user_input.doc

 

I always like to make sure the script is inserting in the table before moving on to form validation whereas others like to do validation as they go. 

 

connect.php:

<?php
$connect = mysql_connect("yourhost","yourusername","yourpassword") or die ("mysql_error");
mysql_select_db("airfield_data") or die(mysql_error());
echo "connected!";
?>

process.php:

<?php
require ("connect.php");


$status = $_POST['status'];
$username = $_POST['username'];
$airfieldname = $_POST['airfieldname'];
$heightabovesealevel = $_POST['heightabovesealevel'];
$generallocation = $_POST['generallocation'];
$co_ordinates = $_POST['co_ordinates'];
$ppr = $_POST['ppr'];
$alternate = $_POST['alternate'];
$airground = $_POST['airground'];
$radiofrequency= $_POST['radiofrequency'];
$runways = $_POST['runways'];
$circuits = $_POST['circuits'];
$remarks = $_POST['remarks'];
$warnings = $_POST['warnings'];
$ophours = $_POST['ophours'];
$contacts = $_POST['contacts'];
$landingfee = $_POST['landingfee'];

$sql=mysql_query("INSERT INTO user_input(status, username,airfieldname, heightabovesealevel,generallocation, co_ordinates,ppr,alternate,airground,radiofrequency,runways,circuits,remarks,warnings,ophours, contacts, landingfee) VALUES
('".$_POST['status']."','".$_POST['username']."','".$_POST['airfieldname']."','".$_POST['heightabovesealevel']."','".$_POST['generallocation']."','".$_POST['co_ordinates']."','".$_POST['ppr']."','".$_POST['alternate']."','".$_POST['airground']."','".$_POST['radiofrequency']."','".$_POST['runways']."','".$_POST['circuits']."','".$_POST['remarks']."','".$_POST['warnings']."','".$_POST['ophours']."',".$_POST['contacts'].",'".$_POST['landingfee']."')");



?> 

form.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

<style type='text/css'> 

body{
    margin-left: 18px;
    margin-top: 18px;
}

body{
    font-family : Verdana, Arial, Helvetica, sans-serif;
    font-size : 13px;
    color : #474747;
    background-color: transparent;
}

select, option{
    font-size:13px;
}

ol.phpfmg_form{
    list-style-type:none;
    padding:0px;
    margin:0px;
}

ol.phpfmg_form li{
    margin-bottom:5px;
    clear:both;
    display:block;
    overflow:hidden;
width: 100%
}


.form_field, .form_required{
    font-weight : bold;
}

.form_required{
    color:red;
    margin-right:8px;
}

.field_block_over{
}

.form_submit_block{
    padding-top: 3px;
}

.text_box, .text_area, .text_select {
    width:300px;
}

.text_area{
    height:80px;
}

.form_error_title{
    font-weight: bold;
    color: red;
}

.form_error{
    background-color: #F4F6E5;
    border: 1px dashed #ff0000;
    padding: 10px;
    margin-bottom: 10px;
}

.form_error_highlight{
    background-color: #F4F6E5;
    border-bottom: 1px dashed #ff0000;
}

div.instruction_error{
    color: red;
    font-weight:bold;
}

hr.sectionbreak{
    height:1px;
    color: #ccc;
}

#one_entry_msg{
    background-color: #F4F6E5;
    border: 1px dashed #ff0000;
    padding: 10px;
    margin-bottom: 10px;
}

    



</style>



<div class='form_description'>

</div>



<form name="flying" action='process.php' method='post' enctype='multipart/form-data' >


            
            
<ol class='phpfmg_form' >



<li class='field_block' id='field_1_div'><div class='col_label'>
<label class='form_field'>status</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="status"   class='text_box'>
<div id='field_1_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_2_div'><div class='col_label'>
<label class='form_field'>username</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="username"  id="field_2" value="" class='text_box'>
<div id='field_2_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_2_div'><div class='col_label'>
<label class='form_field'>Airfield Name</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="airfieldname"   class='text_box'>
<div id='field_2_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_3_div'><div class='col_label'>
<label class='form_field'>Height Above Sea Level</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="heightabovesealevel"   class='text_box'>
<div id='field_3_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_4_div'><div class='col_label'>
<label class='form_field'>General Location</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="generallocation" id="generallocation" rows=4 cols=25 class='text_area'></textarea>

<div id='field_4_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_5_div'><div class='col_label'>
<label class='form_field'>Co-ordinates</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="co_ordinates"   class='text_box'>
<div id='field_5_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_6_div'><div class='col_label'>
<label class='form_field'>Prior Permission Required</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<select name="ppr" class='text_select'  >	
<option value="yes" >yes</option>	
<option value="no" >no</option>	
</select>
<div id='field_6_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_7_div'><div class='col_label'>
<label class='form_field'>Alternative Field</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="alternate"  id="field_7" value="" class='text_box'>
<div id='field_7_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_8_div'><div class='col_label'>
<label class='form_field'>Air Ground Radio</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<select name="airground" class='text_select'width = 20pt>	
<option value="Yes" >Yes</option>	
<option value="No" >No</option>	
</select>
<div id='field_8_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_9_div'><div class='col_label'>
<label class='form_field'>Radio Frequency</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="radiofrequency"   class='text_box'>
<div id='field_9_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_10_div'><div class='col_label'>
<label class='form_field'>Runways</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="runways"  rows=4 cols=25 class='text_area'></textarea>

<div id='field_10_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_11_div'><div class='col_label'>
<label class='form_field'>Circuits</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="circuits"  rows=4 cols=25 class='text_area'></textarea>

<div id='field_11_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_12_div'><div class='col_label'>
<label class='form_field'>Remarks</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="remarks"  rows=4 cols=25 class='text_area'></textarea>

<div id='field_12_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_13_div'><div class='col_label'>
<label class='form_field'>Warnings</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="warnings" id="field_13" rows=4 cols=25 class='text_area'></textarea>

<div id='field_13_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_14_div'><div class='col_label'>
<label class='form_field'>Operating Hours</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="ophours"   value="" class='text_box'>
<div id='field_14_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_15_div'><div class='col_label'>
<label class='form_field'>Contacts</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<textarea name="contacts"  rows=4 cols=25 class='text_area'></textarea>

<div id='field_15_tip' class='instruction'></div>
</div>
</li>

<li class='field_block' id='field_16_div'><div class='col_label'>
<label class='form_field'>Landing Fee</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="text" name="landingfee"  id="field_16" value="" class='text_box'>
<div id='field_16_tip' class='instruction'></div>
</div>
</li>
<br><input type="submit" value="Submit">            


</form>







</body>
</html> 

user_input.doc:

Field Type Null Default

id int(11) No

status varchar(20) No

username varchar(50) No

heightabovesealevel text No

genderallocation text No

co_ordinates varchar(20) No

ppr varchar(2) No

alternate varchar(50) No

airground varchar(3) No

radiofrequency varchar(10) No

runways varchar(20) No

circuits varchar(20) No

remarks text No

warnings text No

ophours varchar(50) No

contacts varchar(200) No

landingfee varchar(20) No

airfieldname text No

 

 

Hi V,

Here's some good news for you,

This script below works, just create the table with this:

CREATE TABLE IF NOT EXISTS `data` (

  `id` int(11) NOT NULL AUTO_INCREMENT,

  `username` varchar(20) NOT NULL,

  `airfieldname` varchar(20) NOT NULL,

  `heightabovesealevel` int(5) NOT NULL,

  `generallocation` varchar(100) NOT NULL,

  `co_ordinates` varchar(20) NOT NULL,

  `ppr` varchar(3) NOT NULL,

  `alternate` text NOT NULL,

  `airground` varchar(3) NOT NULL,

  `radiofrequency` double NOT NULL,

  `runway` varchar(30) NOT NULL,

  `circuit` varchar(200) NOT NULL,

  `status` varchar(10) NOT NULL,

  `remarks` text NOT NULL,

  `warnings` text NOT NULL,

  `ophours` varchar(50) NOT NULL,

  `contacts` text NOT NULL,

  `landingfee` varchar(20) NOT NULL,

  PRIMARY KEY (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=83 ;

 

Then run the below script.  I've put everything into one file this time.  I've tested it and it works. 

-adjust the mysql_connect  part to fit your parameters.

 

you should be able to plug it right in.

then check your db to see if data has been inserted.

If so, then you can start making it look more symetrical and colorful (I'll let you do that).

You should also check to see if your display page is showing the data that has been entered.

 

You can also change the datatypes of the table since I'm not sure and just gave everything text or varchar.

 

Once you are satisfied with that it'll be time for form validation (making sure everyone behaves when they enter data).

 

you can call it insert.php if you'd like

<?php
$connect = mysql_connect("yourhost","yourusername","yourpassword") or die ("mysql_error");
mysql_select_db("yourdbname") or die(mysql_error());
echo "connected to your database!";
?>

<html>
<body>

<form action="mysql_insert.php" method="POST">
Status: <input type="text" name="status" /><br>
Username: <input type="text" name="username" /><br>
Airfield Name: <input type="text" name="airfieldname" /><br>
Height Above Sea Level <input type="text" name="heightabovesealevel" /><br>
General Location <input type="text" name="generallocation" /><br>
Co-ordinates <input type="text" name="co_ordinates" /><br>
<!--Prior Permission Required <input type="text" name="ppr" /> -->
Prior Permission Required<select name='ppr' class='text_select'  >	
<option value="yes" >yes</option>	
<option value="no" >no</option>	
</select><br>


Alternate Airfield<input type="text" name="alternate" />
<!--
Air to Ground Radio<input type="text" name="airground" /> -->
Air To Ground Radio
<select name='airground' class='text_select'width = 20pt>	
<option value="Yes" >Yes</option>	
<option value="No" >No</option>	
</select><br>

Radio Frequency<input type="text" name="radiofrequency" /><br>
Runway<input type="text" name="runway" /><br>
Circuit<input type="text" name="circuit" /><br>
Remarks<input type="text" name="remarks" /><br>
Warnings<input type="text" name="warnings" /><br>
Operating Hours<input type="text" name="ophours" /><br>
Contacts<input type="text" name="contacts" /><br>
Landing Fee<input type="text" name="landingfee" /><br>


<input type="submit" />
</form>


<?php

$status = $_POST['status'];
$username = $_POST['username'];
$airfieldname = $_POST['airfieldname'];
$heightabovesealevel = $_POST['heightabovesealevel'];
$generallocation = $_POST['generallocation'];
$co_ordinates = $_POST['co_ordinates'];
$ppr = $_POST['ppr'];
$alternate = $_POST['alternate'];
$airground = $_POST['airground'];
$radiofrequency= $_POST['radiofrequency'];
$runway= $_POST['runway'];
$circuits = $_POST['circuit'];
$remarks = $_POST['remarks'];
$warnings = $_POST['warnings'];
$ophours = $_POST['ophours'];
$contacts = $_POST['contacts'];
$landingfee = $_POST['landingfee'];

   

$sql=mysql_query("INSERT INTO data(status, username, airfieldname, heightabovesealevel,generallocation,co_ordinates,ppr,alternate,airground,radiofrequency,runway,circuit,remarks,warnings,ophours,contacts,landingfee) VALUES
('".$_POST['status']."','".$_POST['username']."','".$_POST['airfieldname']."','".$_POST['heightabovesealevel']."','".$_POST['generallocation']."','".$_POST['co_ordinates']."','".$_POST['ppr']."','".$_POST['alternate']."','".$_POST['airground']."','".$_POST['radiofrequency']."','".$_POST['runway']."','".$_POST['circuit']."','".$_POST['remarks']."','".$_POST['warnings']."','".$_POST['ophours']."','".$_POST['contacts']."','".$_POST['landingfee']."')");



?> 

 

 

Vince,

I don't know how much you are interested in php mysql coding or if your just passing through but I always recommend books by Larry Ullman

He is known for "Translating geek into English"

Personally, I won't touch a php book that doesn't have his name on it.

 

Hi Nomadsoul.

 

Thanks for you input.  I made a new DB and run your script great, thanks. 

 

However, I have run the form and I get the following error message.

 

"Cannot find mysql_insert.php"

 

Regards

VinceG

 

Oh and thanks for the book recommendation.  I've ordered it from Amazon.

Hi Nomadsoul.

 

Thanks for that.  I've just joined Larry's forum too as "microlight"

 

I have just saved the script you pasted as mysql_insert.php and have loaded it to a temporary folder on my website.

 

I have made another database with all of the names you have been looking for and I still get a blank white screen as soon as I press the submit button.

 

There is no data inserted into the database.  It has however put in an empty row.

 

I'm now working through this "Larry" book and have decided to start again.  I will do the exercises in the book in order and by the time I get to the right place I will hopefully have learned enough to get through it.

 

Thanks again for all your input.

A blank screen should mean your db connection is working.  Do you have a deadline on your website or is it your own project?

Sorry that you've had so much trouble. 

Your book certainly arrived fast. 

Which book and which forum did you join?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.