![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
VinceGledhill
Members-
Posts
133 -
Joined
-
Last visited
Everything posted by VinceGledhill
-
Please help, trying to input data into DB driving me crazy.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
I've changed the die statements. and I've changed the insert and the die. I'm still getting blank screen and nothing inserted. Sorry for being THICK. I really am a newbie and it's driving me potty. <?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"]; //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()); /* $sql01 = "INSERT INTO users SET username = '$username',height_above = '$height_above', mb_diff = $mb_diff, alternative = $alternative"; $result=mysql_query($sql01); */ //mysql_query("INSERT INTO users VALUES ('$username','$height_above','$mb_diff','$alternative')"); mysql_query("INSERT INTO users (username, height_above, mb_diff, alternative) VALUES ('$username', '$height_above', '$mb_diff', '$alternative'"); ?> Regards VinceG -
Please help, trying to input data into DB driving me crazy.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
I've changed the die statements. But sorry, I can't get my head around your stating that I should put "values" in there. Surely the values come from the variables set by the user as he is filling in the form? -
Please help, trying to input data into DB driving me crazy.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Thanks for your input Muddy Funster. I have updated as you said and I now have got rid of the errors and show the form. However, when I fill it in and click the button I get the config01.php page (which is now blank) and no error messages and nothing into the DB. Here's my two files <!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 include "config01.php"?> <form name = 'form1' method = 'post' action='config01.php'> <table width="700" border="1" cellspacing="5" cellpadding="5"> <caption> Submit Your Airfield Details </caption> <tr> <td width="100"> </td> <td width="200">Your Name</td> <td width="200"><input type='text' name='username' maxlength='30'></td> <td width="100"> </td> </tr> <tr> <td> </td> <td>Height Above MSL</td> <td><input type='text' name='height_above'maxlength= '30'></td> <td> </td> </tr> <tr> <td> </td> <td>Mb Difference</td> <td><input type='text' name='mb_diff'maxlength='40'></td> <td> </td> </tr> <tr> <td> </td> <td>Alternative Airfield</td> <td><input type='text' name='alternative' maxlength='30'></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><input type='submit' name='submit' value='post' /></td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </body> </html> <?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"]; //connect to database mysql_connect ("$host","$usr","$password") or die ('Error During Connect:<br>'.mysql_error()); mysql_select_db ("$db_name") or die ("cannot select DB"); /* $sql01 = "INSERT INTO users SET username = '$username',height_above = '$height_above', mb_diff = $mb_diff, alternative = $alternative"; $result=mysql_query($sql01); */ mysql_query("INSERT INTO users VALUES ('$username','$height_above','$mb_diff','$alternative')"); ?> -
Please help, trying to input data into DB driving me crazy.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Just uncommented the include "config01.php" and I don't even get the form up. All I get is "can't connect to the server message" if you see my actual code you will see the "actual message" to say it's driving me potty is an understatement. Regards VinceG -
Please help, trying to input data into DB driving me crazy.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Hi Ken. I'm commenting out the includes because with them in the form won't load. Perky416. I actually have 5 fields in the db. How do I handle the auto incrementing user_id (primary field)? (see picture attached) Code now as below... Still get the can't connect message <body> <?php //include "connection_file.php" //include "config01.php" //$user_id = $_POST[""]; //$username = $_POST["username"]; //$height_above = $_POST["height_above"]; //$mb_diff = $_POST["mb_diff"]; //$alternative = $_POST["alternative"]; ?> <form name = 'form1' method = 'post' action='config01.php'> <table width="700" border="1" cellspacing="5" cellpadding="5"> <caption> Submit Your Airfield Details </caption> <tr> <td width="100"> </td> <td width="200">Your Name</td> <td width="200"><input type='text' name='username' maxlength='30'></td> <td width="100"> </td> </tr> <tr> <td> </td> <td>Height Above MSL</td> <td><input type='text' name='height_above'maxlength= '30'></td> <td> </td> </tr> <tr> <td> </td> <td>Mb Difference</td> <td><input type='text' name='mb_diff'maxlength='40'></td> <td> </td> </tr> <tr> <td> </td> <td>Alternative Airfield</td> <td><input type='text' name='alternative' maxlength='30'></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><input type='submit' name='submit' value='post' /></td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </body> </html> Here is the code for the config01.php <?php $host = 'localhost'; $username = 'VinnyG'; $password = 'thepassword'; $db_name = 'sitename'; $username = $_POST["username"]; $height_above = $_POST["height_above"]; $mb_diff = $_POST["mb_diff"]; $alternative = $_POST["alternative"]; //connect to database mysql_connect ("$host","$username","$password")or die ("cannot connect to server for fuck sake this is driving me potty"); mysql_select_db ("$db_name") or die ("cannot select DB"); /* $sql01 = "INSERT INTO users SET username = '$username',height_above = '$height_above', mb_diff = $mb_diff, alternative = $alternative"; $result=mysql_query($sql01); */ mysql_query("INSERT INTO users VALUES ('$username','$height_above','$mb_diff','$alternative')"); ?> Thanks again for your valued input guys. I've been to the local shop for "beer" Regards Vince [attachment deleted by admin] -
Please help, trying to input data into DB driving me crazy.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Thanks for your input guys. I have corrected the errors but still it doesn't move stuff into the database. I thought that it could be the fact that the user_id which is the primary and is auto-incrementing was the problem so I took the info out. Now all I get is everything passed to config01.php and a blank screen. Please someone help before I loose the plot altogether. <body> <?php //include "connection_file.php" //include "config01.php" //$user_id = $_POST[""]; $username = $_POST["username"]; $height_above = $_POST["height_above"]; $mb_diff = $_POST["mb_diff"]; $alternative = $_POST["alternative"]; ?> <form name = 'form1' method = 'post' action='config01.php'> <table width="700" border="1" cellspacing="5" cellpadding="5"> <caption> Submit Your Airfield Details </caption> <tr> <td width="100"> </td> <td width="200">Your Name</td> <td width="200"><input type='text' name='username' maxlength='30'></td> <td width="100"> </td> </tr> <tr> <td> </td> <td>Height Above MSL</td> <td><input type='text' name='height_above'maxlength= '30'></td> <td> </td> </tr> <tr> <td> </td> <td>Mb Difference</td> <td><input type='text' name='mb_diff'maxlength='40'></td> <td> </td> </tr> <tr> <td> </td> <td>Alternative Airfield</td> <td><input type='text' name='alternative' maxlength='30'></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><input type='submit' name='submit' value='post' /></td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </body> </html> Here is the config01.php I move the "post it" stuff out of the form and into this file but still nothing, no errors now though but still nothing in the DB. <?php $host = 'localhost'; $username = 'VinnyG'; $password = 'thepassword'; $db_name = 'sitename'; //connect to database mysql_connect ("$host","$username","$password")or die ("cannot connect to server"); mysql_select_db ("$db_name") or die ("cannot select DB"); $sql01 = "INSERT INTO users SET username = '$username',height_above = '$height_above', mb_diff = $mb_diff, alternative = $alternative"; $result=mysql_query($sql01); ?> If I could see what was going on it would help. But a blank screen is no help whatsoever. Regards VinceG -
Hi People. I am trying to insert data from a form into my database. Now I have the following code to connect to the DB to update a table so I know that I can connect to the DB ok <?php // this code I got from the new boston, PHP tutorial 25 in selecting a mysql db // opens connection to mysql server $dbc = mysql_connect('localhost', 'VinnyG', 'thepassword'); if (!$dbc) { die("Not Connected:" . mysql_error ()); } // select database $db_selected = mysql_select_db ("sitename",$dbc); if(!$db_selected) { die("can not connect:" . mysql_error ()); } // testing code $query="UPDATE users SET username = 'testing testing' WHERE user_id = '2'"; $result=mysql_query($query); ?> Now here is the code from my form. </head> <body> <?php //include "connection_file.php" //include "config01.php" $username = "username"; $height_above = "height_above"; $mb_diff = "mb_diff"; $alternative = "alternative"; ?> <form name = 'form1' method = 'post' action='config01.php'> <table width="700" border="1" cellspacing="5" cellpadding="5"> <caption> Submit Your Airfield Details </caption> <tr> <td width="100"> </td> <td width="200">Your Name</td> <td width="200"><input type='text' name='username' maxlength='30'></td> <td width="100"> </td> </tr> <tr> <td> </td> <td>Height Above MSL</td> <td><input type='text' name='height_above'maxlength= '30'></td> <td> </td> </tr> <tr> <td> </td> <td>Mb Difference</td> <td><input type='text' name='mb_diff'maxlength='40'></td> <td> </td> </tr> <tr> <td> </td> <td>Alternative Airfield</td> <td><input type='text' name='alternative' maxlength='30'></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><input type='submit' name='submit' value='post' /></td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> <?php $sql01 = "INSERT INTO users SET user_id = '', username = '$username',height_above = '$height_above', mb_diff = $mb_diff, alternative = $alternative"; $result=mysql_query($sql01); ?> </body> </html> here is the config01.php that the form refers to in the 'action' above. <?php $host = 'localhost'; $username = 'VinnyG'; $password = 'thepassword'; $db_name = 'sitename'; //connect to database mysql_connect ("$host","$username","password")or die ("cannot connect to server"); mysql_select_db ("db_name") or die ("cannot select DB"); ?> Please could someone look at the above code and tell me where I'm going wrong. I can connect to the DB and update using the top script but I can't submit the form for some reason. I get a "cannot connect to server" message. Please someone help. It's been driving me crazy for the past two days. Regards VinceG http://www.microlightforum.com
-
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
I got the latest book, sql6 etc. I joined the forum that is mentioned in Larrys book, The project is my own so there's no time limit on it. -
Hello People. Please can someone point me to where I can learn to program the following all one one page? Here is a screenshot of what I'm after. Idea being that you put hours and minutes into the top row. Then hours and minutes into the next row. Click the button and get the answer at the bottom. The answer to 1 hour 40 minutes added to 1 hour 40 minutes should obviously be 3 hours 20 minutes. Here's how I would approach it in another language, but am brand new to php hence the help required. Make the following variables. Hour1 Hour2 Minute1 Minute2 Total_Hours Total_Minutes Combined_Time I would then write something like Total_minutes = minute1 + Minute2 Total_hours = Hour1 + hour2 combined time = Total_hours * 60 + (Total_Minutes) // reset the total hours Total_hours = 0 Loop here.... while combined_time >60 Total_hours = Total_hours + 1 combined_time = combined time -60 re-do the loop Now in the boxes at the bottom put bottom hour box = total hours bottom minute box = combined_time (remaining minutes) here's the code I have so far. <!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="527" border="0" cellspacing="5" cellpadding="5" bgcolor="#c0c5c9"> <p>Time Calculator</p> <p>Put your hours and minutes in the top boxes. Click the add time button<br /> to get the answer </p> <table width="401" border="1" cellspacing="5" cellpadding="5"> <tr> <td width="109"><input type="int" name="hour01" size="10" maxlength="10" /> Hrs</td> <td width="251"><input type="int" name="min01" size="10" maxlength="10" /> Mins</td> </tr> <tr> <td><input type="int" name="hour02" size="10" maxlength="10" /> Hrs</td> <td><input type="int" name="min02" size="10" maxlength="10" /> Mins</td> </tr> <tr> <td><input type="submit" name="submit" value="Add Time" /></td> <td><input name="hour_answer" type="int" size="10" maxlength="10" /> Hrs <input type="int" name="minute_answer" size="10" maxlength="10" /> Mins</td> </tr> </table> <tr></tr> </body> </html>
-
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
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. -
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
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. -
How do I monitor what is going on?
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Hi Sam. Thanks for the input, I've done that and I still get the same problem, blank screen. -
How do I monitor what is going on?
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Thanks for your help guys. I will take a look when I get home at the weekend, I'm away on business at the moment. Can't wait now! It was driving me nuts. This forum and the help I've received so far with my coding has been awesome, thanks! -
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Brilliant, thanks again for your efforts, as I said in my last post I am away on business until Friday, so can't plug it in and test on my DB until then. Typing this on my iPad in a hotel room in Sweden. :-) -
hello People. I have been on a very steep learning curve and with great help from some people here I'm starting to get my stuff together. I am trying to get the info out of a form so that I can eventually process it as a form on my website. What I would like to know is what can I add, so that I can see what is going on? At the moment, I upload all the flies to a temp directory on my site. I load the form, fill it in and press the submit button. It then loads the process.php file but all I get is a blank screen, and nothing has been dumped in the database. So I know it's not working but I don't know how to debug it. Here is the code for my form. <!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="process.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>Approved?</strong></td> <td align="left" valign="middle" bgcolor="#D6FFDC"><strong> <input type="varchar" name="approved" 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="warnings" 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="contactdetails" 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" 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> And here is the code from the process.php file that the above refers to... <!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 require ("connect.php"); $id = $_POST['id']; //$status = $_POST['status']; $name = $_POST['name']; $airfieldname = $_POST['airfieldname']; $heightabovesl = $_POST['heightabovesl']; $generallocation = $_POST['generallocation']; $co_ords = $_POST['co_ords']; $priorpermission = $_POST['priorpermission']; $alternatefield = $_POST['alternatefield']; $airground = $_POST['airground']; $radiofrequency= $_POST['radiofrequency']; $runways = $_POST['runways']; $surface = $_POST['surface']; $circuits = $_POST['circuits']; $remarks = $_POST['remarks']; $warnings = $_POST['warnings']; $ophours = $_POST['ophours']; $contactdetails = $_POST['contactdetails']; $landingfee = $_POST['landingfee']; $google_iframe = $_POST['google_iframe']; $approved = $_POST['approved']; $sql=mysql_query("INSERT INTO user_input(id,name,airfieldname, heightabovesl,generallocation, co_ords,priorpermission,alternatefield,airground,radiofrequency,runways,surface,circuits,remarks,warnings,ophours, contactdetails, landingfee,google_iframe,approved) VALUES ('".$_POST['id']."','".$_POST['name']."','".$_POST['airfieldname']."','".$_POST['heightabovesl']."','".$_POST['generallocation']."','".$_POST['co_ords']."','".$_POST['priorpermission']."','".$_POST['alternatefield']."','".$_POST['airground']."','".$_POST['radiofrequency']."','".$_POST['runways']."','".$_POST['surface']."','".$_POST['circuits']."','".$_POST['remarks']."','".$_POST['warnings']."','".$_POST['ophours']."',".$_POST['contactdetails'].",'".$_POST['landingfee']."','".$_POST['google_iframe']."','".$_POST['approved']."'); ?> </body> </html> And here is the code from the connect.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> <?php $connect = mysql_connect("localhost","my_DB_name","my_password") or die ("mysql_error"); mysql_select_db("airfield_data") or die(mysql_error()); echo "connected!"; ?> </body> </html>
-
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
No problem my friend. I am away myself on business on Wednesday / Thursday / Friday this week myself. So maybe we could re-visit it at the weekend. Regards Vince -
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
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> -
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
You can have a look at the card for ince blundell found here http://microlight.co/index.php/ince The iframe is 700 and if you look at the form above in dreamweaver, you can see that also is 700px wide. -
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
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> -
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Brilliant, thanks for that nomadsoul, I would be lost without you. I have taken your form and put a table below it. Please could you "cut" your first field and show me what I need to "paste" into the table to make the form fit my table format? This tabular design would fit better onto my website. Once you have shown me what to "cut" and paste by doing the first one, I'll do the rest. I was very doubtful at first if I would ever be able to get this done, but with your help I really am starting to believe it. Thanks again for all your help. <!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> <table width="600" border="0" cellspacing="5" cellpadding="5"> <tr> <td width="50"> </td> <td width="250">I.D. (should this be hidden?)</td> <td width="250">Input Box</td> <td width="50"> </td> </tr> <tr> <td> </td> <td>Status (should this be hidden?)</td> <td>Input Box</td> <td> </td> </tr> <tr> <td> </td> <td>Username</td> <td>Input Box</td> <td> </td> </tr> <tr> <td> </td> <td>Airfield Name</td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td>Height Above Sea Level</td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td>General Location</td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td>CoOrdinates</td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td>Prior Permission Required</td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </body> </html> -
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
I have taken someone else's form and modified it for my purposes. Please can someone tell me how to take the information that the user enters, then submit it into the database, then get that information and put it into the card and show it on screen. Here is the code from my modified input form. <html> <body> <table width="544" border="0" align="center" cellpadding="1" cellspacing="1" class="tbl_border"> <tr> <td width="540"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tbl_grey_wborder"> <tr> <td class="txt14b_red"><table width="479" border="0" align="center" cellpadding="0" cellspacing="0" class="txt12b_black"> <tr> <td width="8"></td> <td width="152"></td> <td width="281"></td> <td width="38"></td> </tr> <tr> <td colspan="4" class="txt24b_black"><p>Airfield Submission</p> <p> </p></td> </tr> <tr> <td colspan="4" align="center"><?php echo $error; ?> <div align="left"></div></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Your Name:</div></td> <td height="26" align="right" class="txt_main12"><input name="username" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['username'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Airfield Name:</div></td> <td height="26" align="right" class="txt_main12"><input name="airfieldname" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['airfieldname'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Height Above Sea:</div></td> <td height="26" align="right" class="txt_main12"><input name="heightabovesea" type="int" class="form-field-white-nar-sm" value="<?php echo $_SESSION['heightabovesea'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">General Location:</div></td> <td height="26" align="right" class="txt_main12"><input name="generallocation" type="text" class="form-field-white-nar-sm" value="<?php echo $_SESSION['generallocation'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Co-Ordinates:</div></td> <td height="26" align="right" class="txt_main12"><input name="co_ords" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['co_ords'] ?>" size="30" maxlength="20" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">PPR Required?:</div></td> <td height="26" align="right" class="txt_main12"><input name="ppr" type="bool" class="form-field-white-nar-sm" value="<?php echo $_SESSION['ppr'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Alternate Airfield:</div></td> <td height="26" align="right" class="txt_main12"><input name="alternate" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['alternate'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Air Ground Radio:</div></td> <td height="26" align="right" class="txt_main12"><input name="airground" type="bool" class="form-field-white-nar-sm" value="<?php echo $_SESSION['airground'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Radio Frequency:</div></td> <td height="26" align="right" class="txt_main12"><input name="radiofrequency" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['radiofrequency'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Runways:</div></td> <td height="26" align="right" class="txt_main12"><input name="radiofrequency" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['radiofrequency'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Circuits:</div></td> <td height="26" align="right" class="txt_main12"><input name="circuits" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['circuits'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Remarks:</div></td> <td height="26" align="right" class="txt_main12"><input name="remarks" type="text" class="form-field-white-nar-sm" value="<?php echo $_SESSION['remarks'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Warnings:</div></td> <td height="26" align="right" class="txt_main12"><input name="warnings" type="text" class="form-field-white-nar-sm" value="<?php echo $_SESSION['warnings'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Operating Hours:</div></td> <td height="26" align="right" class="txt_main12"><input name="ophours" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['ophours'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Contacts:</div></td> <td height="26" align="right" class="txt_main12"><input name="contacts" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['contacts'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="20"> <td height="26"> </td> <td height="26" class="txt12_black"><div align="left">Landing Fee:</div></td> <td height="26" align="right" class="txt_main12"><input name="landingfee" type="varchar" class="form-field-white-nar-sm" value="<?php echo $_SESSION['landingfee'] ?>" size="30" maxlength="50" /></td> <td height="26"><font class="text-required-orng"> <img src="images/required_field.gif" width="8" height="9" hspace="0" vspace="0" border="0" align="top" /></font></td> </tr> <tr height="10"> <td height="10"><img src="web_forms/images/bgcolor_pixel.gif" width="1" height="1" /></td> <td height="10" colspan="2" align="right"><img src="web_forms/images/bgcolor_pixel.gif" width="1" height="1" /></td> <td height="10"><img src="web_forms/images/bgcolor_pixel.gif" width="1" height="1" /></td> </tr> <tr height="35"> <td height="35"> </td> <td height="35" colspan="2" align="right" valign="bottom" class="txt_main_str12"> <input type="button" name="Reset" value="Check Airfield Card" onclick="ShowCard();"> <input type="button" name="Submit" value="Submit Airfield Card" onclick="SubmitForm(); return false;" ></td><td height="35"> </td> </tr> <tr height="15"> <td height="25"> </td> <td height="25" colspan="2" align="right"> </td> <td height="25"> </td> </tr> </table></td> </tr> </table></td> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p><br> </p> </div> </form> </div> </body> </html> Holy CODE tags! -
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Thanks for all your input guys. I have added an ID tag and set it to auto increment and have also added the "approved" column to the DB. The problem with altering the Joomla extension page is that I don't know exactly where the code is to be found. So given that I can't get at the particular php file that holds it, I'm at a loss to do anything with it. I haven't been able to test to see if it connects to the DB because I don't know how. Please could someone give me instructions. Or do I just get on with writing my form? Then testing it as I go? -
How do I take input and put it into a table.
VinceGledhill replied to VinceGledhill's topic in PHP Coding Help
Hi PFMaBiSmAd. Thanks for your input. Yes the current "form to e-mail" is a joomla extension. It is mad4joomla http://extensions.joomla.org/extensions/contacts-and-feedback/forms/5597 Do you think I could modify this form? It would be handy because it does look like it "fits" on the website.