Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. each table i have uses an id I know about id's, and how to associate them and all of that if that's what you mean. THis situation however is a little different, I am basing them off a list, so they are preset, it's a list of checkboxs, I am finding out which one's where checked and which one's were not, so I ended up using name/value's pair, even fenway said this is the best choice here, so I saved them. I saved them like that, they database just in the main table, under value pairs, I have them in the same table, because I didn't know how to construct a table of pre-made pairs. The one's for action taken are [quote]Aborted Takeoff Cancelled Flight Declared Emergency Delayed Flight Diversion Go Around Ground Aircraft at Outstation Inflight Shutdown Missed Approach Return Aircraft to Maintenance Return to Gate Turnback [/quote] The one's for classification are [quote]Aircraft Damage Aircraft on Runway "Aircraft Logs / Manuals / Phase Missing, incomplete, inaccurate" Airport Closure Alternator Failure ATC Delay Avionics Failure Communication Navigation Battery Bird Strike Brake Failure Collision (with aircraft or object) Crew Incapacitation Debris on Runway Deviation of ATC Instructions Disruptive / Sick Passenger Door Warning Door Opening Electrical Failure Emergency Evacuation Engine Failure Engine Fire Fire / Smoke in Cabin Flap Failure Flat Tire Flight Control Failure Fuel Leak Fuel Quantity Hard Landing Icing Instrument Failure Flight Instrument Engine Instrument Landing Gear Blow Down Fail to Extend Fail to Retract Hydraulic Leak Hydraulic System Failure Indication Failure Lightening Strike Magneto (failed or rough) Near Mid-Air Collission Pax Injury Prop Strike Rough Engine Runway Incursion Starter (failure or warning) Tail Strike Turbulence Vacuum Failure Wake Turbulence Weather Below Minimums Weather Below High Minimums Weight and Balance Wind Shear Other[/quote] This is the list of action taken, and classification. There are a bunch of checkboxes, if they are selected they are recorded in a session array, if not they are left blank.  later they are databased, I need the same thing later though, I need to extract hem, I named them in the database as actiontaken_ and classification_ however it's the same thing even having them in the same other than different, if they were in a different table then it would still be the same fields.
  2. I tried encryption for almost 2 months, I like the mcrypt library, but it takes months, and months to really leard. Just run it through an md5($variable) then when you check it check it like this // first when you store the data like a password // store data $password = mysql_real_escape_string(md5($_POST['password'])); // later on retrieval $password = "whatever"; // this would be the user inputted password if (md5($password) == $storedpassword ) { echo "login correct"; }
  3. Do I have to manually pull each and every one out of the database, and into an array manually.  That will take forever though, is there another way, I was just think, I could sit there for 2 hour's, taking each variable, testing if it's blank or not, and putting it into a large array,a dn once it's acquired just doing it like I did before. Because I have to do this on 2 instances, one for them being able to edit data and one for them being able to view the data (the comma list)
  4. Ok in the database I have a lot of fields. There are a lot of misc one's, which I have handled already. There are however 2 groups of associated data actiontaken classification They are named in the database with the prefix before hand like everything related to action taken is named actiontaken_variable actiontaken_variable inside the database that is the name of the fields, the values themselves are either filled in with the same name, or they are blank For instance actiontaken_fell actiontaken_ran actiontaken_walked the values are fell, ran, and walkted respectively, but if they were not entered, then they are just blank. I need to go into the database, under a field, for instance id #1, I search that up, I display all my info, but when I get to this set of data, I need to pull everything with actiontaken_ at the beginning of the field name, I need to be able to then display it in a comma delimited list on the page showing what actions where taken, the same for classifications, I was using this they were in an array called $_SESSION['temp']['actiontaken'] all the variable/value pairs were in that array, and I did the list like this [code]<?php if (isset($_SESSION['temp']['actiontaken'])) { foreach($_SESSION['temp']['actiontaken'] as $val1) { echo $val1 . ", "; } }else { echo "None"; } ?>[/code] With this it took them all now I am not sure how to do the same thing just pull them from teh database, I need to know which one's were filled out, and elave hte one's that are blank alone, or d on't show them when it comes up. I can't figure out a way, with classifications, since it was a lot more, and more advanced, I used [code]<?php echo "<td class=\"leftcol\"><strong>Classification(s):</strong></td>\n<td class=\"rightcol\">"; echo implode(", ", $_SESSION['temp']['classification']); ?>[/code] This is what I did to get the same result, just doing it a different way, well all 52 fields of classification are also int eh database, in the same manner, they have  a classification_ before each name so it's field names classification_name1 classification_name2 classification_name3 so for instance if name 1 and 2 were filled out then on the display page, I need it to come back and show name1, name2 but I am not able to figure out how to get this functionality with a database, any advice?
  5. I tried it that way, it worked some but had troubles with the arrays it wasn't reading them, so I redid it the other way based on what you said [code]<?php $insert = "INSERT INTO eventreport (name, t_number, flighttype, aircrafttype, aircraftnumber, eventdate, eventtime, flightnumber, flightnumberselect, scheduleddepartureairport, scheduledarrivalairport, captain, firstofficer, flightattendant, additionalcrewmembers, weather, flightplan, pax, lapchildren, actiontaken_abortedtakeoff, actiontaken_canceledflight, actiontaken_declaredemergency, actiontaken_delayedflight, actiontaken_diversion, actiontaken_goaround, actiontaken_groundaircraftatoutstation, actiontaken_inflightshutdown, actiontaken_missedapproach, actiontaken_returnaircrafttomaintenance, actiontaken_returntogate, actiontaken_turnback) VALUES ('$_SESSION[temp][name]', '$_SESSION[temp][t-number]', '$_SESSION[temp][flighttype]', '$_SESSION[temp][aircrafttype]', '$_SESSION[temp][aircraftnumber]', '$_SESSION[temp][eventdate]', '$_SESSION[temp][eventtime]', '$_SESSION[temp][flightnumber]', '$_SESSION[temp][flightnumberselect]', '$_SESSION[temp][scheduleddepartureairport]', '$_SESSION[temp][scheduledarrivalairport]', '$_SESSION[temp][captain]', '$_SESSION[temp][firstofficer]', '$_SESSION[temp][flightattendant]', '$_SESSION[temp][additionalcrewmembers]','$_SESSION[temp][weather]', '$_SESSION[temp][flightplan]', '$_SESSION[temp][pax]', '$_SESSION[temp][lapchildren]','$_SESSION[temp][actiontaken][abortedtakeoff]', '$_SESSION[temp][actiontaken][canceledflight]', '$_SESSION[temp][actiontaken][declaredemergency]', '$_SESSION[temp][actiontaken][delayedfligh]', '$_SESSION[temp][actiontaken][diversion]', '$_SESSION[temp][actiontaken][goaround]', '$_SESSION[temp][actiontaken][grountaircraftatoutstation]', '$_SESSION[temp][actiontaken][inflightshutdown]', '$_SESSION[temp][actiontaken][missedapproach]', '$_SESSION[temp][actiontaken][returnaircrafttomaintenance]', '$_SESSION[temp][actiontaken][returntogate]', '$_SESSION[temp][actiontaken][turnback]')"; if (mysql_query($insert)) { echo "Record entered successfully.<br />"; }else { echo "There was a problem inserting the record, please hit the back button "; echo "and try again.<br />"; echo mysql_error(); echo $insert; } ?>[/code] It fixed my syntax error's, but it moved me into another error, now all it's returning for the array's is array[something] inside the database, it's not databasing the variable, but some wierd name instead, called array. Before I was getting a syntax errors but my array values were coming through, now there is not syntax errors but hte arrays are not coming through?
  6. I used mysql_real_escape_string on all variables while I was working with validation and setting the sessions. I did that one each and every variable. I am learning a lot of new stuff 1. more with functions 2. Array's a lot more than i use to 3. Readyh pre-built functions ( I use to have some problems reading some of them) plus countless other things along with this one project.
  7. Yes it's in all pages, and when I echo out the insert statement it is showing all the variables, as I showed in the output, it's strange why it's not work? Any advice?
  8. I have been trying to get this to work for awhile. I have a query that is giving me a syntax error, I think because of my sessions. [code]<?php if (!isset($_SESSION['temp']['flightnumber'])) { $_SESSION['temp']['flightnumber'] = "none"; } if (!isset($_SESSION['temp']['flightnumberselect'])) { $_SESSION['temp']['flightnumberselect'] = "none"; } if (!isset($_SESSION['temp']['actiontaken']['abortedtakeoff'])) { $_SESSION['temp']['actiontaken']['abortedtakeoff'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['canceledflight'])) { $_SESSION['temp']['actiontaken']['canceledflight'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['declaredemergency'])) { $_SESSION['temp']['actiontaken']['declaredemergency'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['delayedflight'])) { $_SESSION['temp']['actiontaken']['delayedflight'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['diversion'])) { $_SESSION['temp']['actiontaken']['diversion'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['goaround'])) { $_SESSION['temp']['actiontaken']['goaround'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['groundaircraftatoutstation'])) { $_SESSION['temp']['actiontaken']['groundaircraftatoutstation'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['inflightshutdown'])) { $_SESSION['temp']['actiontaken']['inflightshutdown'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['missedapproach'])) { $_SESSION['temp']['actiontaken']['missedapproach'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['returnaircrafttomaintenance'])) { $_SESSION['temp']['actiontaken']['returnaircrafttomaintenance'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['returntogate'])) { $_SESSION['temp']['actiontaken']['returntogate'] = "no"; } if (!isset($_SESSION['temp']['actiontaken']['turnback'])) { $_SESSION['temp']['actiontaken']['turnback'] = "no"; } $insert = "INSERT INTO eventreport (name, t_number, flighttype, aircrafttype, aircraftnumber, eventdate, eventtime, flightnumber, flightnumberselect, scheduleddepartureairport, scheduledarrivalairport, captain, firstofficer, flightattendant, additionalcrewmembers, weather, flightplan, pax, lapchildren, actiontaken_abortedtakeoff, actiontaken_canceledflight, actiontaken_declaredemergency, actiontaken_delayedflight, actiontaken_diversion, actiontaken_goaround, actiontaken_groundaircraftatoutstation, actiontaken_inflightshutdown, actiontaken_missedapproach, actiontaken_returnaircrafttomaintenance, actiontaken_returntogate, actiontaken_turnback) VALUES (" . $_SESSION['temp']['name'] . ", " . $_SESSION['temp']['t-number'] . ", " . $_SESSION['temp']['flighttype'] . ", " . $_SESSION['temp']['aircrafttype'] . ", " . $_SESSION['temp']['aircraftnumber'] . ", " . $_SESSION['temp']['eventdate'] . ", " . $_SESSION['temp']['eventtime'] . ", " . $_SESSION['temp']['flightnumber'] . ", " . $_SESSION['temp']['flightnumberselect'] . ", " . $_SESSION['temp']['scheduleddepartureairport'] . ", " . $_SESSION['temp']['scheduledarrivalairport'] . ", " . $_SESSION['temp']['captain'] . ", " . $_SESSION['temp']['firstofficer'] . ", " . $_SESSION['temp']['flightattendant'] . ", " . $_SESSION['temp']['additionalcrewmembers'] . ", " . $_SESSION['temp']['weather'] . ", " . $_SESSION['temp']['flightplan'] . ", " . $_SESSION['temp']['pax'] . ", " . $_SESSION['temp']['lapchildren'] . ", " . $_SESSION['temp']['actiontaken']['abortedtakeoff'] . ", " . $_SESSION['temp']['actiontaken']['canceledflight'] . ", " . $_SESSION['temp']['actiontaken']['declaredemergency'] . ", " . $_SESSION['temp']['actiontaken']['delayedfligh'] . ", " . $_SESSION['temp']['actiontaken']['diversion'] . ", " . $_SESSION['temp']['actiontaken']['goaround'] . ", " . $_SESSION['temp']['actiontaken']['grountaircraftatoutstation'] . ", " . $_SESSION['temp']['actiontaken']['inflightshutdown'] . ", " . $_SESSION['temp']['actiontaken']['missedapproach'] . ", " . $_SESSION['temp']['actiontaken']['returnaircrafttomaintenance'] . ", " . $_SESSION['temp']['actiontaken']['returntogate'] . ", " . $_SESSION['temp']['actiontaken']['turnback'] . ")"; if (mysql_query($insert)) { echo "Record entered successfully.<br />"; }else { echo "There was a problem inserting the record, please hit the back button "; echo "and try again.<br />"; echo mysql_error(); echo $insert; } }else { echo "You came to this page from an incorrect location.<br />"; } ?>[/code] This is giving me an error instead of working. It's returning [quote]There was a problem inserting the record, please hit the back button and try again. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '121, ATR42, N14834, 12/05/1992, 1231, dfg, none, sdfgfds, okm, lkm, lkm, lkm, lk' at line 1INSERT INTO eventreport (name, t_number, flighttype, aircrafttype, aircraftnumber, eventdate, eventtime, flightnumber, flightnumberselect, scheduleddepartureairport, scheduledarrivalairport, captain, firstofficer, flightattendant, additionalcrewmembers, weather, flightplan, pax, lapchildren, actiontaken_abortedtakeoff, actiontaken_canceledflight, actiontaken_declaredemergency, actiontaken_delayedflight, actiontaken_diversion, actiontaken_goaround, actiontaken_groundaircraftatoutstation, actiontaken_inflightshutdown, actiontaken_missedapproach, actiontaken_returnaircrafttomaintenance, actiontaken_returntogate, actiontaken_turnback) VALUES (west, asdasd, Part 121, ATR42, N14834, 12/05/1992, 1231, dfg, none, sdfgfds, okm, lkm, lkm, lkm, lkm, lkm, VFR, kjnl, km, Aborted Takeoff, no, no, , no, Go Around, , no, no, no, no, no)[/quote] I tried writing the query multiple way's, so I started using concatenations last, I tried putting sessions just in the string, adn everything else, then I finally had to create those things above the querie on different variables I knew that might be empty, if there empty then I name it no, because I knew that was one of the problem's, but after all that debugging and fixing there are still syntax problems somewhere, and other than that, that's only have to query, I cut it in half to test it ebfroe doing the whole thing, the query qill actually double when I am done, I just wanted to test if it was going to work up to this point and it'sn ot.
  9. Well I had solved it, but now I see 2 new things you mentioned I didn't know, I will keep those in mind and play with them, I knew about the quote's, but I always used double because you can't extrapolate with singlle, but i have also started using concatenations (excuse spelling, don't feel like looking it up), I started using those so single quotes might be the way to go. Thanks again for the advice.
  10. I have this [code]<?php function select($name, $label, $value, $priority) { if ($priority == 1) { $select = "selected=\"selected\""; } echo "<td style=\"text-align:right;\"><input name=\"{$name}\" type=\"checkbox\" value=\"{$value}\" {$select} /></td>\n"; echo "<td style=\"text-align:left;\"><label for=\"{$name}\">{$label}</label></td>\n"; } ?>[/code] I am calling it in multiple places, like [code]<?php select("actiontaken[goaround]", "Go Around", "Go Around", 0); ?> [/code] I feed it either 0-1 depending on the situation, and it's returning [quote]Warning: Missing argument 4 for select() in /home/ninksafe/public_html/master/config/functions/validation.inc.php on line 84[/quote] I don't understand why the error is appearing there?
  11. Ah thanks, I was using it wrong, thanks again.
  12. [code]<?php implode(", ", $_SESSION['temp']['actiontaken']) ?>[/code] This will take an array and put it in a comma seperated list for display, but it's taking the key naturally, I need to find an alternative so I can get the "values" themselves in a comma seperated list.  Implode is for the key's in an array, what is for the values in an array.
  13. [code]Array (     [phaseofflight] => none     [classification] => Array         (             [doorwarningwhichone] =>             [dooropeningwhichone] =>             [flightinstrumentwhich] =>             [engineinstrumentwhich] =>             [othertext] =>         )     [description] =>     [submit] => continue ) [/code] This is what is outputted.
  14. Why the hell do you people think I am some sort of damn joke. You think I am some kind of funny kid, that doesn't know what the hell he's doing. Either way I carry 16 hour work day's I study all the time, I think I know a little more than the basics of what I am talking about, and what I am doing. I want to start something up for fun, in my spare time, I don't do graphic design anymore, I have someone to do that for me, as far as functionality, it'll take me about a year, with all I want to do on it, but it's not hard getting the "functionality" of gamespot, or gamefaqs.  Most of the stuff on those are basic feature's, just put together in a good manner.  Everytime I come on here, I don't feel like people thinking I am a damn joke about everything I talk about.
  15. One of a side website I am going to build, in my spare time, as part of a network of site's I am going to build 1. for fun 2. to enhance my portfolio 3. Just to get some practice. I am wanting to build something with the good/combined functionality of www.videogames.com www.gamefaqs.com and www.gamesages.com atleast. This is going to be a massive, massive, massively sized website, with lot's and lot's of functionality.  Unlike the which the video game community has ever seen, but it'll be totally free, and since it's going to be huge.  There might be a paid account but I doubt it, I was wanting advice on added functionality, or what you like/dislike about gamefaqs, or gamespot, so I can mimick some of the functionality, while expanding out in other way's that I have in mind.
  16. Well there are over now 100 fields almost int he database, 50 just for classification. I just ended up having to set them to either yes/no whether or not they were selected, but calling the data is going to be murderous
  17. unfortunately that's what I went ahead and had to do.
  18. I am recieving a large volume of data from check boxes. Here is the actual field information [code] <form name="form3" id="form3" action="eventincidentaccidentform4.php" method="post"> <table class="test"> <tr> <td colspan="4" style="text-align:left;"><h2>Action Taken(Select all that apply)</h2></td> </tr> <?php echo "<tr>"; select("actiontaken[abortedtakeoff]", "Aborted Takeoff", "abortedtakeoff"); select("actiontaken[cancelledflight]", "Cancelled Flight", "cancelledflight"); echo "</tr>"; echo "<tr>"; select("actiontaken[declaredemergency]", "Declared Emergency", "declaredemergency"); select("actiontaken[delayedflight]", "Delayed Flight", "delayedflight"); echo "</tr>"; echo "<tr>"; select("actiontaken[diversion]", "Diversion", "diversion"); select("actiontaken[goaround]", "Go Around", "goaround"); echo "</tr>"; echo "<tr>"; select("actiontaken[groundaircraftatoutstation]", "Ground AirCraft At Outstation", "groundaircraftatoutstation"); select("actiontaken[inflightshutdown]", "In Flight Shutdown", "inflightshutdown"); echo "</tr>"; echo "<tr>"; select("actiontaken[missedapproach]", "Missed Approach", "missedapproach"); select("actiontaken[returnaircrafttomaintenance]", "Return Aircraft To Maintenance", "returnaircrafttomaintenance"); echo "</tr>"; echo "<tr>"; select("actiontaken[returntogate]", "Return To Gate", "returntogate"); select("actiontaken[turnback]", "Turn Back", "turnback"); echo "</tr>"; ?> <tr><td colspan="4"><hr /></td></tr> <tr> <td colspan="4" style="text-align:left;"><label for="phaseofflight"><h2>Phase Of Flight:(Select One)</h2></label></td> </tr> <tr> <td colspan="4"><select name="phaseofflight" id="phaseofflight"> <option selected="selected">Please Select One!</option> <option>Fueling</option> <option>Towing</option> <option>Pre Flight</option> <option>Boarding</option> <option>Taxi Out</option> <option>Runup</option> <option>Takeoff</option> <option>Climb</option> <option>Cruise</option> <option>Holding</option> <option>Decent</option> <option>Approach</option> <option>Landing</option> <option>Taxi In</option> <option>Parking</option> <option>Deplanning</option> <option>Post Flight</option> </select></td> </tr> <tr><td colspan="4"><hr /></td></tr> <tr> <td colspan="4" style="text-align:left;"><h2>Classification(Select all that apply)</h2></td> </tr> <?php echo "<tr>"; select("classification[aircraftdamage]", "Aircraft Damage", "aircraftdamage"); select("classification[aircraftonrunway]", "Aircraft On Runway", "aircraftonrunway"); echo "</tr>"; echo "<tr>"; select("classification[aircraftlogsmanualsorphase]", "Aircraft Logs / Manuals / Phase (missing, incomplete, inaccurate)", "aircraftlogsmanualsorphase"); select("classification[airportclosure]", "Airport Closure", "airportclosure"); echo "</tr>"; echo "<tr>"; select("classification[alternatorfailure]", "Alternator Failure", "alternatorfailure"); select("classification[atcdelay]", "ATC Delay", "atcdelay"); echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"><p style=\"padding-bottom:0px; margin-bottom:0px; text-align:left;\"><b>Avionics Failure</b></p></td>"; echo "</tr>"; echo "<tr>"; select("classification[avionicsfailure-communication]", "Communication", "communication"); echo "<td></td>"; echo "<td></td>"; echo "</tr>"; echo "<tr>"; select("classification[avionicsfailure-navigation]", "Navigation", "navigation"); echo "<td></td>"; echo "<td></td>"; echo "</tr>"; echo "<tr><td colspan=\"4\">&nbsp;</td></tr>"; echo "<tr>"; select("classification[battery]", "Battery", "battery"); select("classification[birdstrike]", "Bird Strike", "birdstrike"); echo "</tr>"; echo "<tr>"; select("classification[brakefailure]", "Brake Failure", "brakefailure"); select("classification[collision]", "Collision (Aircraft Or Object)", "collision"); echo "</tr>"; echo "<tr>"; select("classification[crewincapacitation]", "Crew Incapacitation", "crewincapacitation"); select("classification[debrisonrunway]", "Debris On Runway", "debrisonrunway"); echo "</tr>"; echo "<tr>"; select("classification[deviationofatcinstructions]", "Deviation Of ATC Instructions", "deviationofatcinstructions"); select("classification[distruptiveorsickpassenger]", "Disruptive/Sick Passenger", "disruptiveorsickpassenger"); echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\">&nbsp;</td>"; echo "</tr>"; echo "<tr>"; select("classification[doorwarning]", "Door Warning", "doorwarning"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[doorwarningwhichone]", "Which Door?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\">&nbsp;</td>"; echo "</tr>"; echo "<tr>"; select("classification[dooropening]", "Door Opening", "cdooropening"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[dooropeningwhichone]", "Which Door?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\">&nbsp;</td>"; echo "</tr>"; echo "<tr>"; select("classification[electricalfailure]", "Electrical Failure", "electricalfailure"); select("classification[emergencyevacuation]", "Emergency Evacuation", "emergencyevacuation"); echo "</tr>"; echo "<tr>"; select("classification[enginefailure]", "Engine Failure", "enginefailure"); select("classification[enginefire]", "Engine Fire", "enginefire"); echo "</tr>"; echo "<tr>"; select("classification[fireorsmokeincabin]", "Fire/Smoke In Cabin", "fireorsmokeincabin"); select("classification[flapfailure]", "Flap Failure", "flapfailure"); echo "</tr>"; echo "<tr>"; select("flattire", "Flat Tire", "flattire"); select("flightcontrolfailure", "Flight Control Failure", "flightcontrolfailure"); echo "</tr>"; echo "<tr>"; select("classification[fuelleak]", "Fuel Leak", "fuelleak"); select("classification[fuelquantity]", "Fuel Quantity", "fuelquantity"); echo "</tr>"; echo "<tr>"; select("classification[hardlanding]", "Hard Landing", "hardlanding"); select("classification[icing]", "Icing", "icing"); echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\" style=\"text-align:left;\"><p><b>Instrument Failure?</b></p></td>"; echo "</tr>"; echo "<tr>"; select("classification[flightinstrument]", "Flight Instrument", "flightinstrument"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[flightinstrumentwhich]", "Which One?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[engineinstrument]", "Engine Instrument", "engineinstrument"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[engineinstrumentwhich]", "Which One?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr><td colspan=\"4\">&nbsp;</td></tr>"; echo "<tr>"; echo "<td><label for=\"landinggear\"><b>Landing Gear</b></label></td>"; echo "<td></td><td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[blowdown]]", "Blow Down", "blowdown"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[failtoextend]]", "Fail To Extend", "failtoextend"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[failtoretract]]", "Fail To Retract", "failtoretract"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[hydraulicleak]]", "Hydraulic Leak", "hydraulicleak"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[hydraulicsystelfailure]]", "Hydraulic System Failure", "hydraulicsystelfailure"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[indicationfailure]]", "Indication Failure", "indicationfailure"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\">&nbsp;</td>"; echo "</tr>"; echo "<tr>"; select("classification[lighteningstrike]", "Lightening Strike", "lighteningstrike"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[magnetofailedorrough]", "Magneto (Failed Or Rough):", "magnetofailedorrough"); select("classification[nearmidaircollission]", "Near Mid-Air Collission", "nearmidaircollission"); echo "</tr>"; echo "<tr>"; select("classification[paxinjury]", "Pax Injury", "paxinjury"); select("classification[propstrike", "Prop Strike", "propstrike"); echo "</tr>"; echo "<tr>"; select("classification[roughengine]", "Rough Engine", "roughengine"); select("classification[runwayincursion]", "Runway Incursion", "runwayincursion"); echo "</tr>"; echo "<tr>"; select("classification[starterfailureorwarning]", "Starter (Failure Or Warning)", "failureorwarning"); select("classification[tailstrike]", "Tail Strike", "talestrike"); echo "</tr>"; echo "<tr>"; select("classification[turbulence]", "Turbulence", "turbulence"); select("classification[vacuumfailure]", "Vacuum Failure", "vacuumfailure"); echo "</tr>"; echo "<tr>"; select("classification[waketurbulence]", "Wake Turbulence", "waketurbulence"); select("classification[weatherbelowminimums]", "Weather Below Minimums", "weatherbelowminimums"); echo "</tr>"; echo "<tr>"; select("classification[weatherbelowhighminimums]", "Weather Below High Minimums", "weatherbelowhighminimums"); select("classification[weightandbalance]", "Weight And Balance", "weightandbalance"); echo "</tr>"; echo "<tr>"; select("classification[windshear]", "Wind Shear", "windshear"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[other]", "Other", "cother"); echo "<td colspan=\"2\"></td>"; echo "</tr>"; echo "<tr>"; text("classification[othertext]", "Required(if selected)", 200, ""); echo "<td colspan=\"2\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\">&nbsp;</td>"; echo "<tr>"; echo "<td colspan=\"4\"><label for=\"description\">Brief Description:</label></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"><textarea name=\"description\" id=\"description\" cols=\"30\" rows=\"10\"></textarea></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"><input name=\"submit\" id=\"submit\" type=\"submit\" value=\"Continue\" /> <input name=\"clear\" id=\"clear\" type=\"reset\" value=\"Clear\" /></td>"; echo "</tr>"; ?> </table> </form>[/code] You can see I am starting 1 array, 1 just drop down list, and another array. I have done a good job collecting, and arraying/validating the information. However now it's time for what is coming next, I have to create the database structure, of how to store it. So far I am  making 1 new field of each of the action taken so it's actiontaken-variable actiontaken-variable2 in the database, if they are filled out, then those are put in as the variable name in the database I did the same for phase of flight which was just a select drop down menu, but now I have to do classification and there are like 50 different possible fields of data, I don't really want to create 50 fields of information, and pass through them like that, I don't see how this is going to work Any advice on a decent database strucutre, I have the first part of the table in the database worked out, because they were only text, and stuff on the first 2 form pages, but then I came across this.
  19. yes but when I natuarlly counted the variables.  And simply outputed what the count variable held,without me checking any checkbox's, it started at 5. So I ended up havnig to use that, it automatically set the number to 5
  20. Well I echo'd out the count variable and it returned 5 so for some reason the default was 5, I guess the sub arrays I fed the array, counted out numbers even though no variables were set to those so [code]<?php $n = count($_POST['classification']); if ($n == 5) { $errorhandler .= "You have to check atleast one of the classifications.<br />"; } ?>[/code] Seemed to work, I tested it a few time's and it seem's to function is this going to be reliable int he future as well.
  21. I recently tried that, no luck, I tried counting it in the variable, I tried testing to see if it was 0, and if it was return an error, I don't know, nothing is working. I just need to check the array, see if any check boxes under that array where checked, that's it, any advice?
  22. Ok, by some wierd chance, I learnt how to check the array's, to make sure if they were set, then the proper text field had to be set as well, I also learnt a valuable new skill for later projects. However I can't figure out how to test the classifications array in general to see if any were filled in The only requirement right now, is that atleast 1 of them is filled out, I have tried the following code's and nothing has worked. [code]if (!$_POST['classification']) {   $errorhandler .= "You have to check atleast one of the classifications.<br />"; }[/code] [code]if (!is_array($_POST['classification'])) {   $errorhandler .= "You have to check atleast one of the classifications.<br />"; }[/code] [code] if (!isset($_POST['classification'])) {   $errorhandler .= "You have to check atleast one of the classifications.<br />"; }[/code] if ($_POST['classification'] == "") {   $errorhandler .= "You have to check atleast one of the classifications.<br />"; } None of this stuff is working, I went on to try 4-5 other variations but nothing is seeming to work properly, I don't understand it, any advice would be appreciated.
×
×
  • Create New...

Important Information

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