Thursday, 15 January 2015

php - Getting specific database values based on what was clicked -



php - Getting specific database values based on what was clicked -

i have portion on site shows basic rundown of what's in database based on user's session name. part works way should. however, on same page, i've got area takes values , places them readable area(think film script). want have happen, when user clicks on scenario_id field, readable area populate based on info associated scenario_id clicked. how go doing this? understand have sql injection vulnerability script.

$view_scenarios = mysqli_query($connect, "select * `$scenarios` `instructor` = '$username'"); while($row = mysqli_fetch_assoc($view_scenarios)){ $scenario = "{$row['id']}"; $scenario = str_replace("/", "", $scenario); $date_created = "{$row['created']}"; $initials = "{$row['initials']}"; $dept_winds = "{$row['dept_winds']}"; $dept_visibility = "{$row['dept_vis']}"; $dept_fog = "{$row['dept_fog']}"; $dept_low_clouds = "{$row['dept_low_clouds']}"; $dept_temp = "{$row['dept_temp']}"; $dept_alt = "{$row['dept_alt']}"; $takeoff = "{$row['takeoff']}"; $callsign = "{$row['call_sign']}"; $enroute_winds = "{$row['enroute_winds']}"; echo "<div class='scenario'>"; echo "<input type='hidden' name='" .$scenario ."' id='" .$scenario ."' value='" .$scenario ."' />"; echo "<div class='scenario_id field'>$scenario</div>"; echo "<div class='date_created field'>$date_created</div>"; echo "<div class='initials field'>$initials</div>"; echo "<div class='options field'></div>"; echo "</div>"; } echo "</div>"; echo "<div id='preview'>"; echo "<div id='script'>"; echo "<h4>phoenix atis 127.57</h4>"; echo "<p>this phoenix sky harbor airport info delta, ___zulu weather. wind $dept_winds. visibility $dept_visibility. fog $dept_fog. ceiling $dept_low_clouds overcast. temperature $dept_temp. altimeter $dept_alt. ils runway 07r approach in use, departing runway $takeoff. hazardous weather info available on hiwas, flight watch, or flight service frequencies. advise initial contact have info delta.</p>"; echo "<ol>"; echo "<li>crew conducts total <u>preflight inspection</u>.</li>"; echo "<p>possible preflight abnormal malfunctions.</p>"; echo "<li>initiate electrical abnormal malfunction.</li>"; echo "<p><i>crew should decide on an: (g450) engine start - battery powerfulness (ng-20) or, (g550) (nb-4) ac powerfulness cart or dc powerfulness cart finish preflight.</i></p>"; echo "</ol>"; echo "<h4>phoenix clearance delivery 118.10</h4>"; echo "<p><strong>gulfstream $callsign, phoenix clearance, cleared tuscon international stanfield 3 departure, stanfield. expect 11000 10 minutes after departure. squawk 5225.</strong></p>"; echo "<p><strong>gulfstream $callsign, read correct, contact ground on 132.55 ready taxi.</strong></p>"; echo "<h4>phoenix ground 132.55</h4>"; echo "<ol start='3'>"; echo "<li>crew conducts <u>powerplant start</u></li>"; echo "<li>initiate powerplant abnormal malfunction.</li>"; echo "<li>crew <u>taxis</u> runway $takeoff.</li>"; echo "</ol>"; echo "<p><strong>gulfstream $callsign, taxi runway $takeoff, via hotel 1, hotel 1, study holding short of runway 07r.</strong></p>"; echo "<p><strong>gulfstream $callsign, cross runway 07r, golf game 1, foxtrot 3, contact phoenix tower on 120.9 holding short of runway $takeoff.</strong></p>"; echo "<h4>phoenix tower 120.9</h4>"; echo "<p><strong>gulfstream $callsign, line , wait runway $takeoff.</strong></p>"; echo "<ol start='6'>"; echo "<li>crew completes <u>preflight take-off checks</u>.</li>"; echo "<p><strong>gulsftream $callsign, winds $dept_winds, rnav stanfield, maintain 160 knots on climb out, cleared take-off runway $takeoff.</strong></p>"; echo "<li>crew conducts <u>normal / crosswind / instrument take-off</u> runway $takeoff, flies <u>departure procedure</u>.</li>"; echo "</ol>"; echo "<p>after passing 600'...</p>"; echo "<p><strong>gulfstream $callsign, contact phoenix departure 126.8.</strong></p>"; echo "<h4>phoenix departure 126.8</h4>"; echo "</div>"; echo "<div id='emergencies'></div>"; echo "</div>";

php

No comments:

Post a Comment