CIS 764CIS 764CIS 764CIS 764 Tutorial F06Tutorial F06Tutorial F06Tutorial F06 Vineetha KadiyalaVineetha KadiyalaVineetha KadiyalaVineetha Kadiyala Nayan AnchaNayan AnchaNayan AnchaNayan Ancha Airport Application using PHP Purpose: In this Tutorial we build an application that can be used to display details of flights and to insert the flight details using PHP. Prerequisites: • Install an Apache server on a Windows or Linux machine http://httpd.apache.org/download.cgi • Install PHP on a Windows or Linux machine http://www.php.net/downloads.php • Install or have access to MySQL on a Windows or Linux machine http://www.mysql.com/downloads/index.html Creating Database Tables: In this tutorial we use MySQL database.Creating tables: Select the Database. At create option give the name of the table “Flight” and specify the Number of fields ‘3’. Click GO. Give the structure for the table as follows: Field Type Lentgh/Values flightid int 10 flight_name varchar 20 flight_details varchar 20 NOTE: check the primarykey option for “flightid” field Click SAVE and GO.Insert values using the Insert tab. Click GO. The browse tab shows the table with inserted data.Create another table “Airport” with structure shown below and insert data using the above steps. Field Type Lentgh/Values airportid int 10 ap_name varchar 20 ap_location varchar 20Create another table “Airline” with structure shown below: Field Type Lentgh/Values airport_id int 10 flight_id int 10 flight_number int 10 Source varchar 20 Destination varchar 20Developing the application Step 1: The main page is developed using HTML PART 1 The first link is for “showdetails” , this gives the display of details of any flight or airport based on the selection made in the master page. The selection can be made using the dropdown list (selector) which contains the data i.e flight names and airport names.The PHP code goes this way:The below figure shows the dropdown selection. The below figure shows the details submited upon the selection.The PHP code for above application:PART 2 This part of the application helps in inserting the details into the database.Upon the submission of the data by clicking on the ‘submit’ button the data is inserted into the tables and an acknowledment message is displayed. The last links in the Main page shows the code for each part of the application. The Working link of the Application: URL:
View Full Document