Presentation is loading. Please wait.

Presentation is loading. Please wait.

Internet and Web Application Development Revision.

Similar presentations


Presentation on theme: "Internet and Web Application Development Revision."— Presentation transcript:

1 Internet and Web Application Development Revision

2 9/8/2015 Web 2 Revision 1.What is the difference between Internet and The Word Wide Web ? Internet : a physical network connecting millions of computers using the same protocols for sharing/transmitting information (TCP/IP)  in reality, the Internet is a network of smaller networks World Wide Web: a collection of interlinked multimedia documents that are stored on the Internet and accessed using a common protocol (HTTP) 2. Give 3 examples of Internet-based applications email, telnet, ftp, instant messaging services, file-sharing services

3 9/8/2015 Web 3 Revision 3. Why do we use CSS in html? HTML was never meant to be a presentation language. CSS removes the presentation attributes from the structure allowing reusability, ease of maintainability, and an interchangeable presentation layer. CSS allows us to make global and instantaneous changes easily. 4. Write a CSS code to change the body background-color, the color and text-align of the large bold heading (h1), the font-family and font-size of all paragraphs

4 9/8/2015 Web 4 Revision body { background-color:#d0e4fe; } h1 { color:orange; text-align:center; } p { font-family:"Times New Roman"; font-size:20px; } CSS example! This is a paragraph.

5 9/8/2015 Web 5 Revision 5. What file extension should CSS files have?.css 6. Which tag is used to create paragraphs? 7. Which attribute is used to set inline styles for tags? style 8. PHP server scripts are surrounded by delimiters, which? 9. How do you write "Hello World" in PHP echo "Hello World";

6 9/8/2015 Web 6 Revision 10. Where in an HTML document is the correct place to refer to an external style sheet? In the section 11. All variables in PHP start with which symbol? $ 12. What is the correct way to end a PHP statement? ; 13. How do you get information from a form that is submitted using the "get" method? $_GET[];

7 9/8/2015 Web 7 Revision 14. Which HTML tag is used to define an internal style sheet? 15. Which CSS property controls the text size? font-size 16. Which property is used to change the font of an element? font-family 17. What is the correct way to create a function in PHP? function myFunction() 18.What is the correct way to connect to a MySQL server? mysql_connect(host,username,password); 19. What is the correct way to add 1 to the $count variable? $count++;

8 9/8/2015 Web 8 Revision 15. Which SQL statement is used to extract data from a database? SELECT 16. Which SQL statement is used to delete data from a database? DELETE 17. Inside which HTML element do we put the JavaScript? 18. Where is the correct place to insert a JavaScript? Both the section and the section are correct 19. What is the correct syntax for referring to an external script called "xxx.js"?

9 9/8/2015 Web 9 Revision 20. What is the difference between the Alert Box and the Confirm Box in javascript?  An alert box is often used if you want to make sure information comes through to the user.  When an alert box pops up, the user will have to click "OK" to proceed.  A confirm box is often used if you want the user to verify or accept something.  When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.  If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.

10 9/8/2015 Web 10 Revision 21. What is the result of the following code? function myFunction() { var x="",i; for (i=0;i<5;i++) { x= "The number is " + i + " "; document.write(x); } Click the button to loop through a block of code five times. Try it

11 9/8/2015 Web 11 Revision When the user click on the button named “Try it” the following 5 lines will be displayed : The number is 0 The number is 1 The number is 2 The number is 3 The number is 4

12 9/8/2015 Web 12 Revision 22. Transform the for LOOP into While LOOP function myFunction() { var x="",i=0; while (i<5) { x= "The number is " + i + " "; document.write(x); i++; } }

13 9/8/2015 Web 13 Revision 23. Give 3 javascript mouse events onmouseover/onmouseout - When the mouse passes over an element onmousedown/onmouseup - When pressing/releasing a mouse button onmousedown - When mouse is clicked: Alert which element 24. What will display the next code? Click the button to sort the array. Try it function myFunction() { var fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.sort(); var x=document.getElementById("demo"); x.innerHTML=fruits; }

14 9/8/2015 Web 14 Revision fruits.sort(); var x=document.getElementById("demo"); x.innerHTML=fruits; } This code sort the table fruits and when the user click on the button “Try it”, the content of the table will be displayed in the screen.

15 9/8/2015 Web 15 Revision 25. Write a javascript code to display the current date ad time var d=new Date(); document.write(d);

16 9/8/2015 Web 16 Revision 26. What are the basic steps to Process Databases with PHP and MYSQL? 1.Connect to host server which has Mysql installed 2.Select a database 3.Form an SQL statement 4.Execute the SQL statement and (optionally) return a record set 5.Extract data from recordset using php 6.Close connection

17 9/8/2015 Web 17 Revision 27. Write a php code to connect to MYSQL and select the database named “university”. <?php $host = "127.0.0.1"; $username = "root"; $pswd = ""; $dbName = "university"; $con = mysql_connect($host, $username,$pswd); if (!$con){ die("Could not connect:". mysql_error());} $db = @mysql_select_db($dbName,$con) or die(mysql_error()); if ($db) echo" now you use the university datebase"; ?>

18 9/8/2015 Web 18 Revision 28. Write a php code to create the table : Persons(FirstName varchar(15),LastName varchar(15), Age int ) <?php $host = "127.0.0.1"; $username = "root"; $pswd = ""; $dbName = “university"; $con = mysql_connect($host, $username,$pswd); if (!$con){ die("Could not connect:".mysql_error());} $db = @mysql_select_db($dbName,$con) or die(mysql_error()); $sql = "CREATE TABLE Persons(FirstName varchar(15), LastName varchar(15), Age int )"; mysql_query($sql, $con); ?>

19 9/8/2015 Web 19 Revision 29. Write a php code to insert the following records in the table Persons: (“Ibrahim”, “Moncef”, 40) (“Mohamed”, “Salah”, 30) <?php $host = "127.0.0.1"; $username = "root"; $pswd = ""; $dbName = "mydb"; $con = mysql_connect($host, $username,$pswd); if (!$con){ die("Could not connect:". mysql_error());} $db = @mysql_select_db($dbName,$con) or die(mysql_error()); mysql_query("INSERT INTO Persons VALUES (‘Ibrahim',‘Moncef',40)"); mysql_query("INSERT INTO Persons VALUES (‘Mohamed', ‘Salah', 30)"); mysql_close($con); ?>


Download ppt "Internet and Web Application Development Revision."

Similar presentations


Ads by Google