VinceGledhill Posted April 26, 2011 Share Posted April 26, 2011 Hi People. I am building a webform where users submit airfield data. It is stored in the database and all is well so far. However, on line 109 I say echo "Thank you, your airfield has been submitted"; I would like to say the following.... Thank you for submitting the airfield data, the resulting card will look like this... Then put "this completed form" into the page and not the "submitting form" Source code.... <!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> <?php $host = 'localhost'; $usr = "VinnyG"; $password = 'thepassword'; $db_name = 'sitename'; $username = $_POST['username']; $height_above = $_POST['height_above']; $mb_diff = $_POST['mb_diff']; $alternative = $_POST['alternative']; $ppr = $_POST['ppr']; $general_location = $_POST['general_location']; $location_grid = $_POST['location_grid']; $runway_numbers = $_POST['runway_numbers']; $circuit_direction = $_POST['circuit_direction']; $circuit_height = $_POST['circuit_height']; $runway_length = $_POST['runway_length']; $surface = $_POST['surface']; $food = $_POST['food']; $radio_frequency = $_POST['radio_frequency']; $radio_callsign = $_POST['radio_callsign']; $radio_type = $_POST['radio_type']; $other_radio = $_POST['other_radio']; $fuel = $_POST['fuel']; $landing_fee = $_POST['landing_fee']; $operating_hours = $_POST['operating_hours']; $maintenance = $_POST['maintenance']; $hangarage = $_POST['hangarage']; $parking = $_POST['parking']; $accommodation = $_POST['accommodation']; $school = $_POST['school']; $remarks = $_POST['remarks']; $warnings = $_POST['warnings']; $weblinks = $_POST['weblinks']; $operator = $_POST['operator']; $google_image = $_POST['google_image']; $errorstring = ""; // default value of errorstring if(isset($_POST['submit'])) { // Validate all the code inputs if ($username =="") $errorstring = $errorstring. "Airfield Name<br>"; if ($height_above =="") $errorstring = $errorstring. "Height Above Mean Sea Level<br>"; if ($mb_diff =="") $errorstring = $errorstring. "mb Difference<br>"; if ($alternative =="") $errorstring = $errorstring. "Alternative Airfield<br>"; if ($general_location =="") $errorstring = $errorstring. "General Location<br>"; if ($location_grid =="") $errorstring = $errorstring. "Grid Reference<br>"; if ($runway_numbers =="") $errorstring = $errorstring. "Runway Numbers<br>"; if ($circuit_direction =="") $errorstring = $errorstring. "Circuit Direction<br>"; if ($circuit_height =="") $errorstring = $errorstring. "Circuit Height<br>"; if ($runway_length =="") $errorstring = $errorstring. "Runway Length<br>"; if ($radio_frequency =="") $errorstring = $errorstring. "Radio Frequency<br>"; if ($radio_callsign =="") $errorstring = $errorstring. "Radio Callsign<br>"; if ($other_radio =="") $errorstring = $errorstring. "Other Radio<br>"; if ($landing_fee =="") $errorstring = $errorstring. "Landing Fee<br>"; if ($remarks =="") $errorstring = $errorstring. "Remarks<br>"; if ($warnings =="") $errorstring = $errorstring. "Warnings<br>"; if ($weblinks =="") $errorstring = $errorstring. "Web Links<br>"; if ($operator =="") $errorstring = $errorstring. "Operator<br>"; if ($google_image =="") $errorstring = $errorstring. "Google Image<br>"; // does the errorstring = "nothing"? if ($errorstring !="") echo "You have not put anything in the following fields: <br><br> $errorstring"; //echo "If you have nothing to put in the box please type the word \"None\" or \"N\/A\""; //die ("Please try again, ensuring that you fill out all the fields!"); else { //echo "Your data has been saved"; //connect to database mysql_connect ("$host","$usr","$password") or die ('Error During Connect:<br>'.mysql_error()); mysql_select_db ("$db_name") or die ('Error Selecting DB:<br>'.mysql_error()); $insert_query = "INSERT INTO users (username, height_above, mb_diff, alternative, ppr, general_location, location_grid, runway_numbers, circuit_direction, circuit_height, runway_length, surface, food, radio_frequency, radio_callsign, radio_type, other_radio, fuel, landing_fee, operating_hours, maintenance, hangarage, parking, accommodation, school, remarks, warnings, weblinks, operator, google_image) VALUES ('$username', '$height_above', '$mb_diff', '$alternative', '$ppr', '$general_location', '$location_grid', '$runway_numbers', '$circuit_direction', '$circuit_height', '$runway_length', '$surface', '$food', '$radio_frequency', '$radio_callsign', '$radio_type', '$other_radio', '$fuel', '$landing_fee', '$operating_hours', '$maintenance', '$hangarage', '$parking', '$accommodation' , '$school', '$remarks', '$warnings', '$weblinks', '$operator', '$google_image')"; $insert_action = mysql_query($insert_query) or die ('Error During Insert :<br>'.mysql_error().'<br><br>Error occured running the following code :<br>'.$insert_query); echo "Thank you, Your airfield has been submitted."; // Output what the form looks like // End of how the form looks } } //} ?> <form name = "form1" method ="post" action=""> <table width="700" border="0" cellspacing="5" cellpadding="5" bgcolor = "#c9e1d0"> <caption> Submit Your Airfield Details </caption> <tr> <td width = "50"> </td> <td width = "240"> </td> <td width = "250"> </td> <td width = "160"><b>Example Input</b></td> </tr> <tr> <td> </td> <td>Airfield Name</td> <td><input type='text' name='username' size = '40' maxlength='30' value = '<?php echo $username; ?>'></td> <td>Ince Blundell</td> </tr> <tr> <td> </td> <td>Height Above MSL</td> <td><input type='text' name='height_above' size = '40' maxlength= '30'value = '<?php echo $height_above; ?>'></td> <td>65 Ft</td> </tr> <tr> <td> </td> <td>Mb Difference</td> <td><input type='text' name='mb_diff' size = '40' maxlength='40'value = '<?php echo $mb_diff; ?>'></td> <td>2 Mb</td> </tr> <tr> <td> </td> <td>Alternative Airfield</td> <td><input type='text' name='alternative' size = '40' maxlength='30' value = '<?php echo $alternative; ?>'></td> <td>Sherburn</td> </tr> <tr> <td> </td> <td>PPR?</td> <td><select name = "ppr"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td>Yes</td> </tr> <tr> <td> </td> <td>General Location</td> <td><input type='text' name='general_location' size = '40' maxlength='50' value = '<?php echo $general_location; ?>' /></td> <td>3 Nm North Luton</td> </tr> <tr> <td> </td> <td>Location Grid Reference</td> <td><textarea name= "location_grid" input type = 'text' rows = "2" cols = "29" /><?php echo $location_grid; ?></textarea></td> <td> 53°57'7.68"N<br /> 1°10'30.33"W</td> </tr> <tr> <td> </td> <td>Runway Numbers</td> <td><textarea name= "runway_numbers" input type = 'text' rows = "5" cols = "29" /><?php echo $runway_numbers; ?></textarea></td> <td><p>This format please<br /> 05-23<br /> 18-36<br /> 14-22 </p></td> </tr> <tr> <td> </td> <td>Circuit Direction</td> <td><textarea name= "circuit_direction" input type = "text" rows = "5" cols = "29" /><?php echo $circuit_direction; ?></textarea></td> <td><p>05-LH<br /> 23-RH<br /> 14-LH </p></td> </tr> <tr> <td> </td> <td>Circuit Height</td> <td><input type='text' name='circuit_height' size = '40' maxlength='50' value = '<?php echo $circuit_height; ?>' /></td> <td>1000 Ft</td> </tr> <tr> <td> </td> <td>Runway Length</td> <td><input type='text' name='runway_length' size = '40'maxlength='50' value = '<?php echo $runway_length; ?>' /></td> <td>500m</td> </tr> <tr> <td> </td> <td>Runway Surface</td> <td><select name = "surface"> <option value = "Grass">Grass</option> <option value="Tarmac">Tarmac</option> <option value ="Concrete">Concrete</option> <option value = "Dirt">Dirt</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Food?</td> <td><select name = "food"> <option value = "Cafe">Cafe</option> <option value="None">None</option> <option value ="Tea and Coffee">Tea and Coffee</option> <option value = "Make Your Own">Make Your Own</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Radio Frequency</td> <td><input type='text' name='radio_frequency' size = '40'maxlength='50' value = '<?php echo $radio_frequency; ?>' /></td> <td>135.475</td> </tr> <tr> <td> </td> <td>Radio Callsign</td> <td><input type='text' name='radio_callsign' size = '40'maxlength='50' value = '<?php echo $radio_callsign; ?>' /></td> <td>Rufforth Traffic</td> </tr> <tr> <td> </td> <td>Radio Type</td> <td><select name = "radio_type"> <option value = "Sefety Com">Safety Com</option> <option value="Air Ground">Air Ground</option> <option value ="Approach">Approach</option> <option value = "Tower">Tower</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Other Radio</td> <td><input type='text' name='other_radio' size = '40' maxlength='50' value = '<?php echo $other_radio; ?>' /></td> <td>E.G. if close to MATZ etc</td> </tr> <tr> <td> </td> <td>Fuel</td> <td><select name = "fuel"> <option value = "AvGas">AvGas</option> <option value="MoGas">MoGas</option> <option value ="AvGas and MoGas">AvGas and MoGas</option> <option value = "We will sort you some">We will sort you some</option> <option value = "None">None</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Landing Fee</td> <td><input type='text' name='landing_fee' size = '40' maxlength='50' value = '<?php echo $landing_fee; ?>' /></td> <td> </td> </tr> <tr> <td> </td> <td>Operating Hours</td> <td><select name = "operating_hours"> <option value = "SR - SS">Sunrise - Sunset</option> <option value="See Remarks">Other - See Remarks</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Maintenance?</td> <td><select name = "maintenance"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Hangarage?</td> <td><select name = "hangarage"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Parking?</td> <td><select name = "parking"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Accommodation?</td> <td><select name = "accommodation"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>School?</td> <td><select name = "school"> <option value = "Flexwing">Flexwing </option> <option value="3 Axis">3 Axis</option> <option value="All Microlight">All Mircolight</option> <option value="GA">GA</option> <option value="Gyro">Gyro</option> <option value="Other See Remarks">Other, See Remarks</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Remarks:</td> <td><textarea name= "remarks" input type = 'text' rows = "5" cols = "29" /><?php echo $remarks; ?></textarea></td> <td>As much info as possible 500 characters max</td> </tr> <tr> <td> </td> <td>Warnings:</td> <td><textarea name= "warnings" input="input" type = 'text' rows = "5" cols = "29" /><?php echo $warnings; ?></textarea></td> <td>As much info as possible 500 characters max</td> </tr> <tr> <td> </td> <td>Web Links</td> <td><textarea name= "weblinks" input="input" type = 'text' rows = "3" cols = "29" /><?php echo $weblinks; ?></textarea></td> <td>Link to airfield website</td> </tr> <tr> <td> </td> <td>Operator Details</td> <td><textarea name= "operator" input="input" type = 'text' rows = "3" cols = "29" /><?php echo $operator; ?></textarea></td> <td>As much info as possible</td> </tr> <tr> <td> </td> <td>Google Iframe Image</td> <td><textarea name= "google_image" input="input" type = 'text' rows = "5" cols = "29" /><?php echo $google_image; ?></textarea></td> <td>700 x 700 pixels please.</td> </tr> <tr> <td><input type='submit' name='submit' value='Have-It' /></td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </body> </html> Form to be inserted <table width="720" border="1" bordercolor = "#2c2cf6" textcolor = "#2c2cf6"cellspacing="1" cellpadding="5"> <tr> <td width="120" bgcolor = #E6F8EB>Height Above MSL</td> <td width="120" bgcolor = #E6F8EB>Mb Difference</td> <td width="120" bgcolor = #E6F8EB>Alternative</td> <td width="120" bgcolor = #E6F8EB>PPR?</td> <td width="120" bgcolor = #E6F8EB>Location General</td> <td width="120" bgcolor = #E6F8EB>Location Grid Ref:</td> </tr> <tr> <td bgcolor = #E6F8EB textcolor = #AC1636>{$height_above from DB}</td> <td bgcolor = #E6F8EB>{$mb_diff from DB}</td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> </tr> <tr> <td bgcolor = #f7e5c6>Runway Numbers</td> <td bgcolor = #f7e5c6>Circuit Direction</td> <td bgcolor = #f7e5c6>Circuit Height</td> <td bgcolor = #f7e5c6>Runway Length</td> <td bgcolor = #f7e5c6>Runway Surface</td> <td bgcolor = #f7e5c6>Food? </td> </tr> <tr> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> </tr> <tr> <td bgcolor = #E6F8EB>Radio Frequency</td> <td bgcolor = #E6F8EB>Radio Callsign</td> <td bgcolor = #E6F8EB>Radio Type</td> <td bgcolor = #E6F8EB>Other Radio</td> <td bgcolor = #E6F8EB>Fuel?</td> <td bgcolor = #E6F8EB>Landing Fee £</td> </tr> <tr> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB><p> </p></td> </tr> <tr> <td bgcolor = #f7e5c6>Opperating Hrs</td> <td bgcolor = #f7e5c6>Maintenance</td> <td bgcolor = #f7e5c6>Hangarage</td> <td bgcolor = #f7e5c6>Parking</td> <td bgcolor = #f7e5c6>Accommodation</td> <td bgcolor = #f7e5c6>School ?</td> </tr> <tr> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> </tr> <tr> <td colspan="6"><p>Remarks:</p> <p> </p> <p> </p></td> </tr> <tr> <td colspan="6"><p>Warnings:</p> <p> </p> <p> </p></td> </tr> <tr> <td colspan="3"><p>Website: </p> <p> </p></td> <td colspan="3"><p>Operator:</p> <p> </p></td> </tr> <tr> <td colspan="6">Google Ifram Image</td> </tr> </table> Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 26, 2011 Share Posted April 26, 2011 Save the result card form into another file, call this file resultcard.php Now change line 109 to echo "hank you for submitting the airfield data, the resulting card will look like this...."; include "resultcard.php"; Next change this } } //} ?> <form name = "form1" method ="post" action=""> to } } if(!isset($_POST['submit']) || (isset($_POST['submit']) && !empty($errorstring))) { ?> <form name = "form1" method ="post" action=""> Lastly change </body> </html> to </body> </html> <?php } ?> Now the form will be displayed when the form hasn't been submitted yet or there are errors ($errorstring). If there are no errors then the resultcard will be shown. Quote Link to comment Share on other sites More sharing options...
VinceGledhill Posted April 27, 2011 Author Share Posted April 27, 2011 Thanks for your input wildteen88. I have done as you said (see code below) but it is not showing the card. All I get is the Thank you message and nothing else? I have uploaded "resultcard.php" and it is in the same "folder" as the form_newest.php file. Any ideas? <!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> <?php $host = 'localhost'; $usr = "VinnyG"; $password = 'thepassword'; $db_name = 'sitename'; $username = $_POST['username']; $height_above = $_POST['height_above']; $mb_diff = $_POST['mb_diff']; $alternative = $_POST['alternative']; $ppr = $_POST['ppr']; $general_location = $_POST['general_location']; $location_grid = $_POST['location_grid']; $runway_numbers = $_POST['runway_numbers']; $circuit_direction = $_POST['circuit_direction']; $circuit_height = $_POST['circuit_height']; $runway_length = $_POST['runway_length']; $surface = $_POST['surface']; $food = $_POST['food']; $radio_frequency = $_POST['radio_frequency']; $radio_callsign = $_POST['radio_callsign']; $radio_type = $_POST['radio_type']; $other_radio = $_POST['other_radio']; $fuel = $_POST['fuel']; $landing_fee = $_POST['landing_fee']; $operating_hours = $_POST['operating_hours']; $maintenance = $_POST['maintenance']; $hangarage = $_POST['hangarage']; $parking = $_POST['parking']; $accommodation = $_POST['accommodation']; $school = $_POST['school']; $remarks = $_POST['remarks']; $warnings = $_POST['warnings']; $weblinks = $_POST['weblinks']; $operator = $_POST['operator']; $google_image = $_POST['google_image']; $errorstring = ""; // default value of errorstring if(isset($_POST['submit'])) { // Validate all the code inputs if ($username =="") $errorstring = $errorstring. "Airfield Name<br>"; if ($height_above =="") $errorstring = $errorstring. "Height Above Mean Sea Level<br>"; if ($mb_diff =="") $errorstring = $errorstring. "mb Difference<br>"; if ($alternative =="") $errorstring = $errorstring. "Alternative Airfield<br>"; if ($general_location =="") $errorstring = $errorstring. "General Location<br>"; if ($location_grid =="") $errorstring = $errorstring. "Grid Reference<br>"; if ($runway_numbers =="") $errorstring = $errorstring. "Runway Numbers<br>"; if ($circuit_direction =="") $errorstring = $errorstring. "Circuit Direction<br>"; if ($circuit_height =="") $errorstring = $errorstring. "Circuit Height<br>"; if ($runway_length =="") $errorstring = $errorstring. "Runway Length<br>"; if ($radio_frequency =="") $errorstring = $errorstring. "Radio Frequency<br>"; if ($radio_callsign =="") $errorstring = $errorstring. "Radio Callsign<br>"; if ($other_radio =="") $errorstring = $errorstring. "Other Radio<br>"; if ($landing_fee =="") $errorstring = $errorstring. "Landing Fee<br>"; if ($remarks =="") $errorstring = $errorstring. "Remarks<br>"; if ($warnings =="") $errorstring = $errorstring. "Warnings<br>"; if ($weblinks =="") $errorstring = $errorstring. "Web Links<br>"; if ($operator =="") $errorstring = $errorstring. "Operator<br>"; if ($google_image =="") $errorstring = $errorstring. "Google Image<br>"; // does the errorstring = "nothing"? if ($errorstring !="") echo "You have not put anything in the following fields: <br><br> $errorstring"; //echo "If you have nothing to put in the box please type the word \"None\" or \"N\/A\""; //die ("Please try again, ensuring that you fill out all the fields!"); else { //echo "Your data has been saved"; //connect to database mysql_connect ("$host","$usr","$password") or die ('Error During Connect:<br>'.mysql_error()); mysql_select_db ("$db_name") or die ('Error Selecting DB:<br>'.mysql_error()); $insert_query = "INSERT INTO users (username, height_above, mb_diff, alternative, ppr, general_location, location_grid, runway_numbers, circuit_direction, circuit_height, runway_length, surface, food, radio_frequency, radio_callsign, radio_type, other_radio, fuel, landing_fee, operating_hours, maintenance, hangarage, parking, accommodation, school, remarks, warnings, weblinks, operator, google_image) VALUES ('$username', '$height_above', '$mb_diff', '$alternative', '$ppr', '$general_location', '$location_grid', '$runway_numbers', '$circuit_direction', '$circuit_height', '$runway_length', '$surface', '$food', '$radio_frequency', '$radio_callsign', '$radio_type', '$other_radio', '$fuel', '$landing_fee', '$operating_hours', '$maintenance', '$hangarage', '$parking', '$accommodation' , '$school', '$remarks', '$warnings', '$weblinks', '$operator', '$google_image')"; $insert_action = mysql_query($insert_query) or die ('Error During Insert :<br>'.mysql_error().'<br><br>Error occured running the following code :<br>'.$insert_query); echo "Thank you, Your airfield has been submitted."; include "resultcard.php"; // Output what the form looks like // End of how the form looks } } if(!isset($_POST['submit']) || (isset($_POST['submit']) && !empty($errorstring))) { ?> <form name = "form1" method ="post" action=""> <table width="700" border="0" cellspacing="5" cellpadding="5" bgcolor = "#c9e1d0"> <caption> Submit Your Airfield Details </caption> <tr> <td width = "50"> </td> <td width = "240"> </td> <td width = "250"> </td> <td width = "160"><b>Example Input</b></td> </tr> <tr> <td> </td> <td>Airfield Name</td> <td><input type='text' name='username' size = '40' maxlength='30' value = '<?php echo $username; ?>'></td> <td>Ince Blundell</td> </tr> <tr> <td> </td> <td>Height Above MSL</td> <td><input type='text' name='height_above' size = '40' maxlength= '30'value = '<?php echo $height_above; ?>'></td> <td>65 Ft</td> </tr> <tr> <td> </td> <td>Mb Difference</td> <td><input type='text' name='mb_diff' size = '40' maxlength='40'value = '<?php echo $mb_diff; ?>'></td> <td>2 Mb</td> </tr> <tr> <td> </td> <td>Alternative Airfield</td> <td><input type='text' name='alternative' size = '40' maxlength='30' value = '<?php echo $alternative; ?>'></td> <td>Sherburn</td> </tr> <tr> <td> </td> <td>PPR?</td> <td><select name = "ppr"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td>Yes</td> </tr> <tr> <td> </td> <td>General Location</td> <td><input type='text' name='general_location' size = '40' maxlength='50' value = '<?php echo $general_location; ?>' /></td> <td>3 Nm North Luton</td> </tr> <tr> <td> </td> <td>Location Grid Reference</td> <td><textarea name= "location_grid" input type = 'text' rows = "2" cols = "29" /><?php echo $location_grid; ?></textarea></td> <td> 53°57'7.68"N<br /> 1°10'30.33"W</td> </tr> <tr> <td> </td> <td>Runway Numbers</td> <td><textarea name= "runway_numbers" input type = 'text' rows = "5" cols = "29" /><?php echo $runway_numbers; ?></textarea></td> <td><p>This format please<br /> 05-23<br /> 18-36<br /> 14-22 </p></td> </tr> <tr> <td> </td> <td>Circuit Direction</td> <td><textarea name= "circuit_direction" input type = "text" rows = "5" cols = "29" /><?php echo $circuit_direction; ?></textarea></td> <td><p>05-LH<br /> 23-RH<br /> 14-LH </p></td> </tr> <tr> <td> </td> <td>Circuit Height</td> <td><input type='text' name='circuit_height' size = '40' maxlength='50' value = '<?php echo $circuit_height; ?>' /></td> <td>1000 Ft</td> </tr> <tr> <td> </td> <td>Runway Length</td> <td><input type='text' name='runway_length' size = '40'maxlength='50' value = '<?php echo $runway_length; ?>' /></td> <td>500m</td> </tr> <tr> <td> </td> <td>Runway Surface</td> <td><select name = "surface"> <option value = "Grass">Grass</option> <option value="Tarmac">Tarmac</option> <option value ="Concrete">Concrete</option> <option value = "Dirt">Dirt</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Food?</td> <td><select name = "food"> <option value = "Cafe">Cafe</option> <option value="None">None</option> <option value ="Tea and Coffee">Tea and Coffee</option> <option value = "Make Your Own">Make Your Own</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Radio Frequency</td> <td><input type='text' name='radio_frequency' size = '40'maxlength='50' value = '<?php echo $radio_frequency; ?>' /></td> <td>135.475</td> </tr> <tr> <td> </td> <td>Radio Callsign</td> <td><input type='text' name='radio_callsign' size = '40'maxlength='50' value = '<?php echo $radio_callsign; ?>' /></td> <td>Rufforth Traffic</td> </tr> <tr> <td> </td> <td>Radio Type</td> <td><select name = "radio_type"> <option value = "Sefety Com">Safety Com</option> <option value="Air Ground">Air Ground</option> <option value ="Approach">Approach</option> <option value = "Tower">Tower</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Other Radio</td> <td><input type='text' name='other_radio' size = '40' maxlength='50' value = '<?php echo $other_radio; ?>' /></td> <td>E.G. if close to MATZ etc</td> </tr> <tr> <td> </td> <td>Fuel</td> <td><select name = "fuel"> <option value = "AvGas">AvGas</option> <option value="MoGas">MoGas</option> <option value ="AvGas and MoGas">AvGas and MoGas</option> <option value = "We will sort you some">We will sort you some</option> <option value = "None">None</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Landing Fee</td> <td><input type='text' name='landing_fee' size = '40' maxlength='50' value = '<?php echo $landing_fee; ?>' /></td> <td> </td> </tr> <tr> <td> </td> <td>Operating Hours</td> <td><select name = "operating_hours"> <option value = "SR - SS">Sunrise - Sunset</option> <option value="See Remarks">Other - See Remarks</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Maintenance?</td> <td><select name = "maintenance"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Hangarage?</td> <td><select name = "hangarage"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Parking?</td> <td><select name = "parking"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Accommodation?</td> <td><select name = "accommodation"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>School?</td> <td><select name = "school"> <option value = "Flexwing">Flexwing </option> <option value="3 Axis">3 Axis</option> <option value="All Microlight">All Mircolight</option> <option value="GA">GA</option> <option value="Gyro">Gyro</option> <option value="Other See Remarks">Other, See Remarks</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Remarks:</td> <td><textarea name= "remarks" input type = 'text' rows = "5" cols = "29" /><?php echo $remarks; ?></textarea></td> <td>As much info as possible 500 characters max</td> </tr> <tr> <td> </td> <td>Warnings:</td> <td><textarea name= "warnings" input="input" type = 'text' rows = "5" cols = "29" /><?php echo $warnings; ?></textarea></td> <td>As much info as possible 500 characters max</td> </tr> <tr> <td> </td> <td>Web Links</td> <td><textarea name= "weblinks" input="input" type = 'text' rows = "3" cols = "29" /><?php echo $weblinks; ?></textarea></td> <td>Link to airfield website</td> </tr> <tr> <td> </td> <td>Operator Details</td> <td><textarea name= "operator" input="input" type = 'text' rows = "3" cols = "29" /><?php echo $operator; ?></textarea></td> <td>As much info as possible</td> </tr> <tr> <td> </td> <td>Google Iframe Image</td> <td><textarea name= "google_image" input="input" type = 'text' rows = "5" cols = "29" /><?php echo $google_image; ?></textarea></td> <td>700 x 700 pixels please.</td> </tr> <tr> <td><input type='submit' name='submit' value='Have-It' /></td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </body> </html> <?php } ?> Here is the resultcard.php <!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> <table width="720" border="1" bordercolor = "#2c2cf6" textcolor = "#2c2cf6"cellspacing="1" cellpadding="5"> <tr> <td width="120" bgcolor = #E6F8EB>Height Above MSL</td> <td width="120" bgcolor = #E6F8EB>Mb Difference</td> <td width="120" bgcolor = #E6F8EB>Alternative</td> <td width="120" bgcolor = #E6F8EB>PPR?</td> <td width="120" bgcolor = #E6F8EB>Location General</td> <td width="120" bgcolor = #E6F8EB>Location Grid Ref:</td> </tr> <tr> <td bgcolor = #E6F8EB textcolor = #AC1636>{$height_above from DB}</td> <td bgcolor = #E6F8EB>{$mb_diff from DB}</td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> </tr> <tr> <td bgcolor = #f7e5c6>Runway Numbers</td> <td bgcolor = #f7e5c6>Circuit Direction</td> <td bgcolor = #f7e5c6>Circuit Height</td> <td bgcolor = #f7e5c6>Runway Length</td> <td bgcolor = #f7e5c6>Runway Surface</td> <td bgcolor = #f7e5c6>Food? </td> </tr> <tr> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> </tr> <tr> <td bgcolor = #E6F8EB>Radio Frequency</td> <td bgcolor = #E6F8EB>Radio Callsign</td> <td bgcolor = #E6F8EB>Radio Type</td> <td bgcolor = #E6F8EB>Other Radio</td> <td bgcolor = #E6F8EB>Fuel?</td> <td bgcolor = #E6F8EB>Landing Fee £</td> </tr> <tr> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB><p> </p></td> </tr> <tr> <td bgcolor = #f7e5c6>Opperating Hrs</td> <td bgcolor = #f7e5c6>Maintenance</td> <td bgcolor = #f7e5c6>Hangarage</td> <td bgcolor = #f7e5c6>Parking</td> <td bgcolor = #f7e5c6>Accommodation</td> <td bgcolor = #f7e5c6>School ?</td> </tr> <tr> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> <td bgcolor = #f7e5c6> </td> </tr> <tr> <td colspan="6"><p>Remarks:</p> <p> </p> <p> </p></td> </tr> <tr> <td colspan="6"><p>Warnings:</p> <p> </p> <p> </p></td> </tr> <tr> <td colspan="3"><p>Website: </p> <p> </p></td> <td colspan="3"><p>Operator:</p> <p> </p></td> </tr> <tr> <td colspan="6">Google Ifram Image</td> </tr> </table> </body> </html> Quote Link to comment Share on other sites More sharing options...
Drummin Posted April 27, 2011 Share Posted April 27, 2011 Try include("resultcard.php"); Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 27, 2011 Share Posted April 27, 2011 Try include("resultcard.php"); Parenthesis's () are optional. @Vince, If you change echo "Thank you, Your airfield has been submitted."; include "resultcard.php"; to echo "Thank you, Your airfield has been submitted."; include "resultcard.php"; echo "ABC"; If you now fill in the form and submit it does it just show this Thank you, Your airfield has been submitted.ABC Or just Thank you, Your airfield has been submitted. and then nothing else after that? If that is the case then for some reason PHP is halting the script at the include. This could be due to an error. Check your severs error logs for any errors. Quote Link to comment 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.