Aaron Posted December 12, 2011 Report Posted December 12, 2011 I'm trying to make a simple booking system so pilots can make their own routes. I tryed to make it so that the flight number would be the pilots callsign, and the rest is in a form. The problem is it doesn't work and idk why not. Here's the code for the form: <span style="color: rgb(128,0,0)"><strong><span style="font-size: 36px">Flight Booking System</span></strong></span> <form action="http://www.canforce.org/core/modules/Booking/booking.php" method="post"> Departure Airport ICAO: <input type="text" name="depicao" /><br /> Arrival Airport ICAO: <input type="text" name="arricao" /></br> Aircraft: <select name="aircraft" id="aircraft"> <option value="12">CC-130</option> <option value="13">CC-130J</option> <option value="17">CC-150</option> <option value="4">CC-144</option> <option value="7">CT-142</option> <option value="1">CP-140</option> <option value="20">CC-138</option> <option value="22">CU-170</option> <option value="10">CT-156</option> <option value="8">CC-177</option> <option value="3">CC-115</option> <option value="2">CP-140A</option> <option value="19">CT-114</option> <option value="11">CT-155</option> <option value="14">CF-18</option> <option value="16">F-35</option> <option value="18">CH-124</option> <option value="9">CH-146</option> <option value="6">CH-149</option> <option value="15">CH-139</option> <option value="21">CH-148</option> <option value="5">CH-147D</option> </select> </label></br> Route: <input type="text" name="route" /></br> Altitude: <input type="text" name="flightlevel" /></br> <input type="submit" value="Submit" /> </form> And here's the code for the action: <span style="color: rgb(128,0,0)"><strong><span style="font-size: 36px">Booking Results</span></strong></span> <?php $this->set('pilotcode', PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid)); $con = mysql_connect("localhost:3306","canforce_booking","my pasword"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("canforce_phpvmsinstall", $con); $sql="INSERT INTO phpvms_schedules (id, code, flightnum, depicao, arricao, route, aircraft, flightlevel, deptime, arrtime, flighttime, enabled, bidid) VALUES ('$pilotcode','CFC','$pilotcode','$_POST[depicao]','$_POST[arricao]','$_POST[route]','$_POST[aircraft]','$_POST[flightlevel]','00:00','00:00','00:00','1','1')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con) ?> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.