JavaScript and PHP. JavaScript and PHP. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

Size: px
Start display at page:

Download "JavaScript and PHP. JavaScript and PHP. DD1335 (Lecture 8) Basic Internet Programming Spring / 26"

Transcription

1 JavaScript and PHP DD1335 (Lecture 8) Basic Internet Programming Spring / 26

2 A little about JavaScript DD1335 (Lecture 8) Basic Internet Programming Spring / 26

3 JavaScript What is it good for? DD1335 (Lecture 8) Basic Internet Programming Spring / 26

4 JavaScript What is it good for? JavaScript is a general programming language meant to be embedded into HTML pages to enhance the code and to add dynamics to the normally static content of HTML pages. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

5 JavaScript What is it good for? JavaScript is a general programming language meant to be embedded into HTML pages to enhance the code and to add dynamics to the normally static content of HTML pages. It may be used for everything that HTML is used for and much more and it is meant to execute on the client side. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

6 JavaScript What is it good for? JavaScript is a general programming language meant to be embedded into HTML pages to enhance the code and to add dynamics to the normally static content of HTML pages. It may be used for everything that HTML is used for and much more and it is meant to execute on the client side. However, CSS manages most of the problems that JavaScript can manage, so today there are not many reasons left to use it. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

7 JavaScript What is it good for? JavaScript is a general programming language meant to be embedded into HTML pages to enhance the code and to add dynamics to the normally static content of HTML pages. It may be used for everything that HTML is used for and much more and it is meant to execute on the client side. However, CSS manages most of the problems that JavaScript can manage, so today there are not many reasons left to use it. Some small tasks are still best taken care of by JavaScript. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

8 JavaScript What is it good for? JavaScript is a general programming language meant to be embedded into HTML pages to enhance the code and to add dynamics to the normally static content of HTML pages. It may be used for everything that HTML is used for and much more and it is meant to execute on the client side. However, CSS manages most of the problems that JavaScript can manage, so today there are not many reasons left to use it. Some small tasks are still best taken care of by JavaScript. NOTE! JavaScript is case sensitive DD1335 (Lecture 8) Basic Internet Programming Spring / 26

9 JavaScript a universal programming language DD1335 (Lecture 8) Basic Internet Programming Spring / 26

10 JavaScript a universal programming language You can do all kinds of tasks with JavaScript. The special version that is embedded into browsers have some special features though. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

11 JavaScript a universal programming language You can do all kinds of tasks with JavaScript. The special version that is embedded into browsers have some special features though. It has features to reach all objects and parameters of web pages. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

12 JavaScript a universal programming language You can do all kinds of tasks with JavaScript. The special version that is embedded into browsers have some special features though. It has features to reach all objects and parameters of web pages. JavaScript has nothing to do with Java. It originated as LiveScript and changed name for marketing purposes. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

13 JavaScript a universal programming language You can do all kinds of tasks with JavaScript. The special version that is embedded into browsers have some special features though. It has features to reach all objects and parameters of web pages. JavaScript has nothing to do with Java. It originated as LiveScript and changed name for marketing purposes. Most language constructions are as in Java but a weak type system that allows all kinds of values to be bound to a variable: DD1335 (Lecture 8) Basic Internet Programming Spring / 26

14 JavaScript a universal programming language You can do all kinds of tasks with JavaScript. The special version that is embedded into browsers have some special features though. It has features to reach all objects and parameters of web pages. JavaScript has nothing to do with Java. It originated as LiveScript and changed name for marketing purposes. Most language constructions are as in Java but a weak type system that allows all kinds of values to be bound to a variable: var a, s = 3; may be followed by s = "hello"; DD1335 (Lecture 8) Basic Internet Programming Spring / 26

15 JavaScript a universal programming language You can do all kinds of tasks with JavaScript. The special version that is embedded into browsers have some special features though. It has features to reach all objects and parameters of web pages. JavaScript has nothing to do with Java. It originated as LiveScript and changed name for marketing purposes. Most language constructions are as in Java but a weak type system that allows all kinds of values to be bound to a variable: var a, s = 3; may be followed by s = "hello"; Here, variables a and s have been declared and an initial value has been assigned to s. Then s has been given a value of a different type. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

16 Mandatory Hello World JavaScript program DD1335 (Lecture 8) Basic Internet Programming Spring / 26

17 Mandatory Hello World JavaScript program <html> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

18 Mandatory Hello World JavaScript program <html> <head> <title>hello World</title> </head> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

19 Mandatory Hello World JavaScript program <html> <head> <title>hello World</title> </head> <body> </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

20 Mandatory Hello World JavaScript program <html> <head> <title>hello World</title> </head> <body> <script type="text/javascript"> </script> </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

21 Mandatory Hello World JavaScript program <html> <head> <title>hello World</title> </head> <body> <script type="text/javascript"> document.writeln("hello World"); </script> </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

22 JavaScript... JavaScript and PHP DD1335 (Lecture 8) Basic Internet Programming Spring / 26

23 JavaScript... JavaScript and PHP No need to use semicolon ( ; ) unless you put more than one statement on the same line. But as you may end statements with a semicolon, it s best to allways do it. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

24 JavaScript... No need to use semicolon ( ; ) unless you put more than one statement on the same line. But as you may end statements with a semicolon, it s best to allways do it. Strings may be enclosed in quotes ( " ) or in apostrophes ( ) allowing for simple inclusion of these into strings. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

25 JavaScript... No need to use semicolon ( ; ) unless you put more than one statement on the same line. But as you may end statements with a semicolon, it s best to allways do it. Strings may be enclosed in quotes ( " ) or in apostrophes ( ) allowing for simple inclusion of these into strings. var s1 = "it s rather cold today"; var s2 = so the "goblins" stay in their caves ; DD1335 (Lecture 8) Basic Internet Programming Spring / 26

26 JavaScript... No need to use semicolon ( ; ) unless you put more than one statement on the same line. But as you may end statements with a semicolon, it s best to allways do it. Strings may be enclosed in quotes ( " ) or in apostrophes ( ) allowing for simple inclusion of these into strings. var s1 = "it s rather cold today"; var s2 = so the "goblins" stay in their caves ; The string var s3 = s1 + s2; will contain the value it s rather cold today so the "goblins" stay in their caves DD1335 (Lecture 8) Basic Internet Programming Spring / 26

27 JavaScript... JavaScript and PHP You may put your script anywhere in the HTML page but the normal is to put declarations in the <head>...</head> part and the rest exactly where you want things to happen. To check what i mentioned in the previous slide you may put the following in a file (the name ending with.html ): DD1335 (Lecture 8) Basic Internet Programming Spring / 26

28 JavaScript... JavaScript and PHP You may put your script anywhere in the HTML page but the normal is to put declarations in the <head>...</head> part and the rest exactly where you want things to happen. To check what i mentioned in the previous slide you may put the following in a file (the name ending with.html ): <html> <head> <script type="text/javascript"> var s1 = "it s rather cold today"; var s2 = so the "goblins" stay in their caves ; </script> <title>testing javascript strings</title> </head> <body> <script type="text/javascript"> document.write(s1 + s2); </script> </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

29 Find out if JavaScript is turned on (or not available) If you want to use JavaScript in a page, JavaScript must be enabled in the browser. There are no means to ask the browser if JavaScript is enabled, but you may have a page using JavaScript to redirect the user to the real web page and, in case it doesn t work, issue an error message. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

30 Find out if JavaScript is turned on (or not available) If you want to use JavaScript in a page, JavaScript must be enabled in the browser. There are no means to ask the browser if JavaScript is enabled, but you may have a page using JavaScript to redirect the user to the real web page and, in case it doesn t work, issue an error message. <html> <head> <title>javascript test</title> <script type="text/javascript"> location= start.html ; </script> </head> <body> <h4>sorry, JavaScript is not enabled in your browser!</h4> To visit this site, enable JavaScript and then reload this page. </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

31 Hiding JavaScript from not enabled browsers <html> <head> <title>hello World</title> </head> <body> <script type="text/javascript"> <!-- document.writeln("hello World"); // --> </script> </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

32 Checking for JavaScript in enabled browsers <html> <head> <title>checking if JavaScript is on</title> </head> <body> <script type="text/javascript"> <!-- // your JavaScript code here // --> </script> <noscript> Your browser understands JavaScript. However, the feature is turned off. Please turn it on to enjoy the full capability of this page. </noscript> </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

33 Using JavaScript in modern HTML As said, most things that JavaScript can do, are better performed by server side languages, so let s focus on things that are more convenient to do on the client side, e.g. using navigation history or perform form input control. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

34 Using JavaScript in modern HTML As said, most things that JavaScript can do, are better performed by server side languages, so let s focus on things that are more convenient to do on the client side, e.g. using navigation history or perform form input control. Using JavaScript to navigate <html> <head> <title>going back to the previous page</title> </head. <body> The password you typed in is not long enough. Please <a href="javascript:history.back()">go back</a> to correct it. </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

35 Using JavaScript to navigate... <html> <head> <title>going n pages back </title> </head> <body> Click <a href="javascript:history.go(-3)">here</a> to go back to the the beginning of the entry form. </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

36 Using JavaScript to navigate... <html> <head> <title>going n pages back </title> </head> <body> Click <a href="javascript:history.go(-3)">here</a> to go back to the the beginning of the entry form. </body> </html> <html> <head> <title>moving forward</title> </head> <body> Click <a href="javascript:history.go(1)">here</a> to move forward. </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

37 Using JavaScript to navigate... <html> <head> <title>navigating to a CSC course</title> </head> <body> Please select one of the courses below <br /> <form> <select onchange="location= + this.options[this.selectedindex].value"> <option>select a course</option> <option value="dd1334/dbtek10/">dbtek10</option> <option value="dd1335/gruint10/">gruint10</option> <option value="dd2471/moddb10/">moddb10</option> </select> </form> </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

38 Using JavaScript for form input control First we need some basic functions. In the following i omit the <script type="text/javascript"> </script> part as it is obvious that all functions have to be declared inside a script. The isempty function function isempty(str) { if (str == null str == "") return true; return false; } DD1335 (Lecture 8) Basic Internet Programming Spring / 26

39 Using JavaScript for form input control... The trim function function trim(str) { if (str!=null) { while (str.length > 0 && str.charat(str.length - 1) == " ") str = str.substring(0, str.length - 1); while (str.length > 0 && str.charat(0) == " ") str = str.substring(1, str.length); } return str; } Form validating function function validateform(theform) { if (isempty(trim(theform.username.value))) { alert( Please enter a valid name ); return false; } if (isempty(trim(theform.passwd.value))) { alert( Please enter a valid password ); return false; } return true; } DD1335 (Lecture 8) Basic Internet Programming Spring / 26

40 Using JavaScript for form input control... <html> <head><title>form Validation</title> <script type="text/javascript"> // Here is the place for the functions from previous slides </script> </head> <body> <form method="post" action="enter.html" onsubmit= return validateform(this) > <table> <tr><td>name:</td> <td><input type="text" name="username"></td></tr> <tr><td>password:</td> <td><input type="password" name="passwd"></td></tr> <tr><td colspan="2" align="right"> <input type="submit"></td></tr> </table> </form> </body> </html> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

41 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

42 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) Interpreted language DD1335 (Lecture 8) Basic Internet Programming Spring / 26

43 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) Interpreted language Easy to get something done fast DD1335 (Lecture 8) Basic Internet Programming Spring / 26

44 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) Interpreted language Easy to get something done fast Problems when size and complexity grow DD1335 (Lecture 8) Basic Internet Programming Spring / 26

45 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) Interpreted language Easy to get something done fast Problems when size and complexity grow Performance penalty (though addressed in the Zend engine) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

46 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) Interpreted language Easy to get something done fast Problems when size and complexity grow Performance penalty (though addressed in the Zend engine) A number of PHP organisations and hosting services around the net DD1335 (Lecture 8) Basic Internet Programming Spring / 26

47 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) Interpreted language Easy to get something done fast Problems when size and complexity grow Performance penalty (though addressed in the Zend engine) A number of PHP organisations and hosting services around the net A huge catalogue of features developed by volunteers DD1335 (Lecture 8) Basic Internet Programming Spring / 26

48 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) Interpreted language Easy to get something done fast Problems when size and complexity grow Performance penalty (though addressed in the Zend engine) A number of PHP organisations and hosting services around the net A huge catalogue of features developed by volunteers Language in evolution... PHP 5 adds exception handling. OOP is also an add-on: Introduced in PHP4, perfected in PHP5 DD1335 (Lecture 8) Basic Internet Programming Spring / 26

49 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) Interpreted language Easy to get something done fast Problems when size and complexity grow Performance penalty (though addressed in the Zend engine) A number of PHP organisations and hosting services around the net A huge catalogue of features developed by volunteers Language in evolution... PHP 5 adds exception handling. OOP is also an add-on: Introduced in PHP4, perfected in PHP5 most OOP concepts and keywords are as in java: class, extends, interface, private, protected, etc DD1335 (Lecture 8) Basic Internet Programming Spring / 26

50 Quick overview of PHP What is PHP PHP: Hypertext Processor (or Personal Home Page?) Interpreted language Easy to get something done fast Problems when size and complexity grow Performance penalty (though addressed in the Zend engine) A number of PHP organisations and hosting services around the net A huge catalogue of features developed by volunteers Language in evolution... PHP 5 adds exception handling. OOP is also an add-on: Introduced in PHP4, perfected in PHP5 most OOP concepts and keywords are as in java: class, extends, interface, private, protected, etc exceptions are as in Java (try/catch, etc) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

51 What can PHP do? JavaScript and PHP CGI scripting of course DD1335 (Lecture 8) Basic Internet Programming Spring / 26

52 What can PHP do? CGI scripting of course Based on escapes within HTML pages <?php...?> or <%... %> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

53 What can PHP do? CGI scripting of course Based on escapes within HTML pages <?php...?> or <%... %> Command line scripting DD1335 (Lecture 8) Basic Internet Programming Spring / 26

54 What can PHP do? CGI scripting of course Based on escapes within HTML pages <?php...?> or <%... %> Command line scripting GUI applications (PHP-GTK) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

55 Installation JavaScript and PHP Install the PHP interpreter separately. There is good support for this in Linux DD1335 (Lecture 8) Basic Internet Programming Spring / 26

56 Installation Install the PHP interpreter separately. There is good support for this in Linux In the webserver configuration, associate the php extension with the PHP interpreter DD1335 (Lecture 8) Basic Internet Programming Spring / 26

57 Installation Install the PHP interpreter separately. There is good support for this in Linux In the webserver configuration, associate the php extension with the PHP interpreter For serious applications you will need a database engine DD1335 (Lecture 8) Basic Internet Programming Spring / 26

58 Installation Install the PHP interpreter separately. There is good support for this in Linux In the webserver configuration, associate the php extension with the PHP interpreter For serious applications you will need a database engine Apache is the typical choice for the web server. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

59 Installation Install the PHP interpreter separately. There is good support for this in Linux In the webserver configuration, associate the php extension with the PHP interpreter For serious applications you will need a database engine Apache is the typical choice for the web server. Integrated as a module, so no supplementary processes are created (in CGI, typically there is one process per access, which is very expensive) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

60 Installation Install the PHP interpreter separately. There is good support for this in Linux In the webserver configuration, associate the php extension with the PHP interpreter For serious applications you will need a database engine Apache is the typical choice for the web server. Integrated as a module, so no supplementary processes are created (in CGI, typically there is one process per access, which is very expensive) Mysql or PostgreSQL is the typical db engine DD1335 (Lecture 8) Basic Internet Programming Spring / 26

61 Installation Install the PHP interpreter separately. There is good support for this in Linux In the webserver configuration, associate the php extension with the PHP interpreter For serious applications you will need a database engine Apache is the typical choice for the web server. Integrated as a module, so no supplementary processes are created (in CGI, typically there is one process per access, which is very expensive) Mysql or PostgreSQL is the typical db engine Most MS Windows users prefer Mysql DD1335 (Lecture 8) Basic Internet Programming Spring / 26

62 Installation Install the PHP interpreter separately. There is good support for this in Linux In the webserver configuration, associate the php extension with the PHP interpreter For serious applications you will need a database engine Apache is the typical choice for the web server. Integrated as a module, so no supplementary processes are created (in CGI, typically there is one process per access, which is very expensive) Mysql or PostgreSQL is the typical db engine Most MS Windows users prefer Mysql I d choose PostgreSQL as it is more complete in terms of functionality DD1335 (Lecture 8) Basic Internet Programming Spring / 26

63 PHP in HTML JavaScript and PHP The most frequent use of PHP is in scripts embedded in web pages DD1335 (Lecture 8) Basic Internet Programming Spring / 26

64 PHP in HTML The most frequent use of PHP is in scripts embedded in web pages Escaping follows the same rules as in ASP and JSP <?php...?>, <?...?>, <%... %>, <%=.... %> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

65 PHP in HTML The most frequent use of PHP is in scripts embedded in web pages Escaping follows the same rules as in ASP and JSP <?php...?>, <?...?>, <%... %>, <%=.... %> As in JSP, escaping can be interrupted to write some HTML <?php if ($expression) {?> <b>this is true.</b> <?php }?> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

66 PHP in HTML The most frequent use of PHP is in scripts embedded in web pages Escaping follows the same rules as in ASP and JSP <?php...?>, <?...?>, <%... %>, <%=.... %> As in JSP, escaping can be interrupted to write some HTML <?php if ($expression) {?> <b>this is true.</b> <?php }?> You can see the evolution under community pressure, here and in other areas DD1335 (Lecture 8) Basic Internet Programming Spring / 26

67 PHP in HTML The most frequent use of PHP is in scripts embedded in web pages Escaping follows the same rules as in ASP and JSP <?php...?>, <?...?>, <%... %>, <%=.... %> As in JSP, escaping can be interrupted to write some HTML <?php if ($expression) {?> <b>this is true.</b> <?php }?> You can see the evolution under community pressure, here and in other areas Though it is possible to use <script language="php" >...</script>, don t... DD1335 (Lecture 8) Basic Internet Programming Spring / 26

68 PHP in HTML JavaScript and PHP The most frequent use of PHP is in scripts embedded in web pages Escaping follows the same rules as in ASP and JSP <?php...?>, <?...?>, <%... %>, <%=.... %> As in JSP, escaping can be interrupted to write some HTML <?php if ($expression) {?> <b>this is true.</b> <?php }?> You can see the evolution under community pressure, here and in other areas Though it is possible to use <script language="php" >...</script>, don t... the language attribute is deprecated DD1335 (Lecture 8) Basic Internet Programming Spring / 26

69 PHP in HTML JavaScript and PHP The most frequent use of PHP is in scripts embedded in web pages Escaping follows the same rules as in ASP and JSP <?php...?>, <?...?>, <%... %>, <%=.... %> As in JSP, escaping can be interrupted to write some HTML <?php if ($expression) {?> <b>this is true.</b> <?php }?> You can see the evolution under community pressure, here and in other areas Though it is possible to use <script language="php" >...</script>, don t... the language attribute is deprecated PHP is a server side language and the <script> tag is for client side processing DD1335 (Lecture 8) Basic Internet Programming Spring / 26

70 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

71 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript DD1335 (Lecture 8) Basic Internet Programming Spring / 26

72 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

73 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string DD1335 (Lecture 8) Basic Internet Programming Spring / 26

74 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string single-quoted, no character escapes DD1335 (Lecture 8) Basic Internet Programming Spring / 26

75 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string single-quoted, no character escapes double-quoted, with character escapes DD1335 (Lecture 8) Basic Internet Programming Spring / 26

76 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string single-quoted, no character escapes double-quoted, with character escapes $a.$b appends the string b and at the end of the string a DD1335 (Lecture 8) Basic Internet Programming Spring / 26

77 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string single-quoted, no character escapes double-quoted, with character escapes $a.$b appends the string b and at the end of the string a $a(index1, index2) gives a substring DD1335 (Lecture 8) Basic Internet Programming Spring / 26

78 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string single-quoted, no character escapes double-quoted, with character escapes $a.$b appends the string b and at the end of the string a $a(index1, index2) gives a substring string functions in the function library DD1335 (Lecture 8) Basic Internet Programming Spring / 26

79 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string single-quoted, no character escapes double-quoted, with character escapes $a.$b appends the string b and at the end of the string a $a(index1, index2) gives a substring string functions in the function library arrays are mappings between keys and values (Dictionary/Hashtable/Map in java) $arr = array("foo" => "bar", 12 => true) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

80 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string single-quoted, no character escapes double-quoted, with character escapes $a.$b appends the string b and at the end of the string a $a(index1, index2) gives a substring string functions in the function library arrays are mappings between keys and values (Dictionary/Hashtable/Map in java) $arr = array("foo" => "bar", 12 => true) Automactic type conversions between types (very dangerous...). Explicit type conversions exist too DD1335 (Lecture 8) Basic Internet Programming Spring / 26

81 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string single-quoted, no character escapes double-quoted, with character escapes $a.$b appends the string b and at the end of the string a $a(index1, index2) gives a substring string functions in the function library arrays are mappings between keys and values (Dictionary/Hashtable/Map in java) $arr = array("foo" => "bar", 12 => true) Automactic type conversions between types (very dangerous...). Explicit type conversions exist too Classes and objects, OOP DD1335 (Lecture 8) Basic Internet Programming Spring / 26

82 Types JavaScript and PHP A variable name begins with $, no type declaration (type declarations can be required by passing some settings to the interpreter) weak type system as in JavaScript boolean, integer, float, though internally all numbers are floats. string single-quoted, no character escapes double-quoted, with character escapes $a.$b appends the string b and at the end of the string a $a(index1, index2) gives a substring string functions in the function library arrays are mappings between keys and values (Dictionary/Hashtable/Map in java) $arr = array("foo" => "bar", 12 => true) Automactic type conversions between types (very dangerous...). Explicit type conversions exist too Classes and objects, OOP Resources, a kind of reference DD1335 (Lecture 8) Basic Internet Programming Spring / 26

83 Variables JavaScript and PHP See Types DD1335 (Lecture 8) Basic Internet Programming Spring / 26

84 Variables See Types Assignment by value (not by reference) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

85 Variables See Types Assignment by value (not by reference) Lots of predefined variables, especially related to HTTP/CGI DD1335 (Lecture 8) Basic Internet Programming Spring / 26

86 Variables See Types Assignment by value (not by reference) Lots of predefined variables, especially related to HTTP/CGI _SERVER, _GET, _POST, _COOKIE, _FILES, _REQUEST, _SESSION DD1335 (Lecture 8) Basic Internet Programming Spring / 26

87 Variables See Types Assignment by value (not by reference) Lots of predefined variables, especially related to HTTP/CGI _SERVER, _GET, _POST, _COOKIE, _FILES, _REQUEST, _SESSION External variables, useful for forms DD1335 (Lecture 8) Basic Internet Programming Spring / 26

88 Variables See Types Assignment by value (not by reference) Lots of predefined variables, especially related to HTTP/CGI _SERVER, _GET, _POST, _COOKIE, _FILES, _REQUEST, _SESSION External variables, useful for forms Functions as variables DD1335 (Lecture 8) Basic Internet Programming Spring / 26

89 Other procedural stuff JavaScript and PHP Operators similar to Java DD1335 (Lecture 8) Basic Internet Programming Spring / 26

90 Other procedural stuff JavaScript and PHP Operators similar to Java Statements similar to Java, plus: DD1335 (Lecture 8) Basic Internet Programming Spring / 26

91 Other procedural stuff JavaScript and PHP Operators similar to Java Statements similar to Java, plus: <? if(...) :?>...<? endif;?> DD1335 (Lecture 8) Basic Internet Programming Spring / 26

92 Other procedural stuff JavaScript and PHP Operators similar to Java Statements similar to Java, plus: <? if(...) :?>...<? endif;?> foreach () through arrays, just values, or also keys DD1335 (Lecture 8) Basic Internet Programming Spring / 26

93 Other procedural stuff JavaScript and PHP Operators similar to Java Statements similar to Java, plus: <? if(...) :?>...<? endif;?> foreach () through arrays, just values, or also keys foreach (array_expression as $value) statement DD1335 (Lecture 8) Basic Internet Programming Spring / 26

94 Other procedural stuff JavaScript and PHP Operators similar to Java Statements similar to Java, plus: <? if(...) :?>...<? endif;?> foreach () through arrays, just values, or also keys foreach (array_expression as $value) statement foreach (array_expression as $key => $value) statement DD1335 (Lecture 8) Basic Internet Programming Spring / 26

95 Other procedural stuff JavaScript and PHP Operators similar to Java Statements similar to Java, plus: <? if(...) :?>...<? endif;?> foreach () through arrays, just values, or also keys foreach (array_expression as $value) statement foreach (array_expression as $key => $value) statement Code inclusion with require() and include() DD1335 (Lecture 8) Basic Internet Programming Spring / 26

96 Other procedural stuff JavaScript and PHP Operators similar to Java Statements similar to Java, plus: <? if(...) :?>...<? endif;?> foreach () through arrays, just values, or also keys foreach (array_expression as $value) statement foreach (array_expression as $key => $value) statement Code inclusion with require() and include() Conditional function definition (similar to C #ifdef ) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

97 Features JavaScript and PHP HTTP authentication, cookies, file uploads DD1335 (Lecture 8) Basic Internet Programming Spring / 26

98 Features JavaScript and PHP HTTP authentication, cookies, file uploads Remote files (like java.net.urlconnection) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

99 Features JavaScript and PHP HTTP authentication, cookies, file uploads Remote files (like java.net.urlconnection) Connections (like java.net.socket) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

100 Features JavaScript and PHP HTTP authentication, cookies, file uploads Remote files (like java.net.urlconnection) Connections (like java.net.socket) Persistent db connections DD1335 (Lecture 8) Basic Internet Programming Spring / 26

101 Features JavaScript and PHP HTTP authentication, cookies, file uploads Remote files (like java.net.urlconnection) Connections (like java.net.socket) Persistent db connections Normally db connections are defined with engine specific functions as external resources. Each access would open its connection, which is expensive. So applications with extensive use of databases had better use Java or pay a heavy performance penalty. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

102 Functions JavaScript and PHP Array functions, calendar fuctions, date functions, character functions, IO functions, printer, file/directory, etc DD1335 (Lecture 8) Basic Internet Programming Spring / 26

103 Functions Array functions, calendar fuctions, date functions, character functions, IO functions, printer, file/directory, etc Functions for protocols/standards, e.g. FTP, HTTP, URL, LDAP, IRC, Mail, NSAPI, popmail, XML/XSL, Bzip2/Zip/Zlib DD1335 (Lecture 8) Basic Internet Programming Spring / 26

104 Functions Array functions, calendar fuctions, date functions, character functions, IO functions, printer, file/directory, etc Functions for protocols/standards, e.g. FTP, HTTP, URL, LDAP, IRC, Mail, NSAPI, popmail, XML/XSL, Bzip2/Zip/Zlib Functions for various databases (Mysql, Oracle, MS SQL server, msql, PostgreSQL, SQLite, dbase), dbx is general DD1335 (Lecture 8) Basic Internet Programming Spring / 26

105 Functions Array functions, calendar fuctions, date functions, character functions, IO functions, printer, file/directory, etc Functions for protocols/standards, e.g. FTP, HTTP, URL, LDAP, IRC, Mail, NSAPI, popmail, XML/XSL, Bzip2/Zip/Zlib Functions for various databases (Mysql, Oracle, MS SQL server, msql, PostgreSQL, SQLite, dbase), dbx is general Functions for other systems/tools: e.g. Apache, COM, Cyrus, PDF, dbase, DBM, DOM,.NET, Lotus Notes, GNU readline, Hyperware DD1335 (Lecture 8) Basic Internet Programming Spring / 26

106 Conclusions JavaScript and PHP Easy to learn from Java or C DD1335 (Lecture 8) Basic Internet Programming Spring / 26

107 Conclusions JavaScript and PHP Easy to learn from Java or C CGI parameters, HTTP sessions, etc are easy to recognize DD1335 (Lecture 8) Basic Internet Programming Spring / 26

108 Conclusions JavaScript and PHP Easy to learn from Java or C CGI parameters, HTTP sessions, etc are easy to recognize Good language/system for doing something small fast (but then JSP/ASP do most of the same) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

109 Conclusions JavaScript and PHP Easy to learn from Java or C CGI parameters, HTTP sessions, etc are easy to recognize Good language/system for doing something small fast (but then JSP/ASP do most of the same) Not a wise choice for a serious/large project due to the lack of type safety, lack of OOP in the libraries, etc. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

110 Conclusions JavaScript and PHP Easy to learn from Java or C CGI parameters, HTTP sessions, etc are easy to recognize Good language/system for doing something small fast (but then JSP/ASP do most of the same) Not a wise choice for a serious/large project due to the lack of type safety, lack of OOP in the libraries, etc. Experienced PHP people confirm that larger projects tend to become a big mess due to the freedoms that seemed so good in the begining, which make programmers lazy DD1335 (Lecture 8) Basic Internet Programming Spring / 26

111 Conclusions JavaScript and PHP Easy to learn from Java or C CGI parameters, HTTP sessions, etc are easy to recognize Good language/system for doing something small fast (but then JSP/ASP do most of the same) Not a wise choice for a serious/large project due to the lack of type safety, lack of OOP in the libraries, etc. Experienced PHP people confirm that larger projects tend to become a big mess due to the freedoms that seemed so good in the begining, which make programmers lazy The array concept is nice, but its name is misleading (array means something very different in the rest of the field of Computer Science) DD1335 (Lecture 8) Basic Internet Programming Spring / 26

112 Conclusions JavaScript and PHP Easy to learn from Java or C CGI parameters, HTTP sessions, etc are easy to recognize Good language/system for doing something small fast (but then JSP/ASP do most of the same) Not a wise choice for a serious/large project due to the lack of type safety, lack of OOP in the libraries, etc. Experienced PHP people confirm that larger projects tend to become a big mess due to the freedoms that seemed so good in the begining, which make programmers lazy The array concept is nice, but its name is misleading (array means something very different in the rest of the field of Computer Science) Still, a very good choice for pragmatists DD1335 (Lecture 8) Basic Internet Programming Spring / 26

Lecture 12. PHP. cp476 PHP

Lecture 12. PHP. cp476 PHP Lecture 12. PHP 1. Origins of PHP 2. Overview of PHP 3. General Syntactic Characteristics 4. Primitives, Operations, and Expressions 5. Control Statements 6. Arrays 7. User-Defined Functions 8. Objects

More information

PHP: Hypertext Preprocessor. A tutorial Introduction

PHP: Hypertext Preprocessor. A tutorial Introduction PHP: Hypertext Preprocessor A tutorial Introduction Introduction PHP is a server side scripting language Primarily used for generating dynamic web pages and providing rich web services PHP5 is also evolving

More information

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37)

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37) PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37) A Server-side Scripting Programming Language An Introduction What is PHP? PHP stands for PHP: Hypertext Preprocessor. It is a server-side

More information

CSC Web Programming. Introduction to JavaScript

CSC Web Programming. Introduction to JavaScript CSC 242 - Web Programming Introduction to JavaScript JavaScript JavaScript is a client-side scripting language the code is executed by the web browser JavaScript is an embedded language it relies on its

More information

Introduction of PHP Created By: Umar Farooque Khan

Introduction of PHP Created By: Umar Farooque Khan 1 Introduction of PHP Created By: Umar Farooque Khan 2 What is PHP? PHP stand for hypertext pre-processor. PHP is a general purpose server side scripting language that is basically used for web development.

More information

CERTIFICATE IN WEB PROGRAMMING

CERTIFICATE IN WEB PROGRAMMING COURSE DURATION: 6 MONTHS CONTENTS : CERTIFICATE IN WEB PROGRAMMING 1. PROGRAMMING IN C and C++ Language 2. HTML/CSS and JavaScript 3. PHP and MySQL 4. Project on Development of Web Application 1. PROGRAMMING

More information

PHP 1. Introduction Temasek Polytechnic

PHP 1. Introduction Temasek Polytechnic PHP 1 Introduction Temasek Polytechnic Background Open Source Apache License Free to redistribute with/without source code http://www.apache.org/license.txt Backed by Zend Corporation http://www.zend.com

More information

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Web programming The PHP language Our objective Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Access data inserted by users into HTML forms Interact

More information

3 The Building Blocks: Data Types, Literals, and Variables

3 The Building Blocks: Data Types, Literals, and Variables chapter 3 The Building Blocks: Data Types, Literals, and Variables 3.1 Data Types A program can do many things, including calculations, sorting names, preparing phone lists, displaying images, validating

More information

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT. Chapter 7:- PHP Compiled By:- Assistant Professor, SVBIT. Outline Starting to script on server side, Arrays, Function and forms, Advance PHP Databases:-Basic command with PHP examples, Connection to server,

More information

PHP by Pearson Education, Inc. All Rights Reserved.

PHP by Pearson Education, Inc. All Rights Reserved. PHP 1992-2012 by Pearson Education, Inc. All Client-side Languages User-agent (web browser) requests a web page JavaScript is executed on PC http request Can affect the Browser and the page itself http

More information

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015 Fundamentals of Website Development CSC 2320, Fall 2015 The Department of Computer Science Review Web Extensions Server side & Where is your JOB? 1 In this chapter Dynamic pages programming Database Others

More information

All India Council For Research & Training

All India Council For Research & Training WEB DEVELOPMENT & DESIGNING Are you looking for a master program in web that covers everything related to web? Then yes! You have landed up on the right page. Web Master Course is an advanced web designing,

More information

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users Introduction to PHP Let's Look Back We talked about how to create a form in HTML Forms are one way to interact with users Users can enter information into forms which can be used by you (programmer) We

More information

What is PHP? [1] Figure 1 [1]

What is PHP? [1] Figure 1 [1] PHP What is PHP? [1] PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on the server PHP is free to download and use Figure

More information

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Introduction: PHP (Hypertext Preprocessor) was invented by Rasmus Lerdorf in 1994. First it was known as Personal Home Page. Later

More information

PHP. MIT 6.470, IAP 2010 Yafim Landa

PHP. MIT 6.470, IAP 2010 Yafim Landa PHP MIT 6.470, IAP 2010 Yafim Landa (landa@mit.edu) LAMP We ll use Linux, Apache, MySQL, and PHP for this course There are alternatives Windows with IIS and ASP Java with Tomcat Other database systems

More information

Agenda. 1. Brief History of PHP. 2. Getting started. 3. Examples

Agenda. 1. Brief History of PHP. 2. Getting started. 3. Examples PHP An Introduction Agenda 1. Brief History of PHP 2. Getting started 3. Examples Brief History of PHP PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was initially developed

More information

SEEM4570 System Design and Implementation Lecture 03 JavaScript

SEEM4570 System Design and Implementation Lecture 03 JavaScript SEEM4570 System Design and Implementation Lecture 03 JavaScript JavaScript (JS)! Developed by Netscape! A cross platform script language! Mainly used in web environment! Run programs on browsers (HTML

More information

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 (

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 ( Course Title PHP ( Level 1 ( Course Description PHP '' Hypertext Preprocessor" is the most famous server-side programming language in the world. It is used to create a dynamic website and it supports many

More information

B. V. Patel Institute of BMC & IT 2014

B. V. Patel Institute of BMC & IT 2014 Unit 1: Introduction Short Questions: 1. What are the rules for writing PHP code block? 2. Explain comments in your program. What is the purpose of comments in your program. 3. How to declare and use constants

More information

Lecture 3: The Basics of JavaScript. Background. Needs for Programming Capability. Origin of JavaScript. Using Client-side JavaScript

Lecture 3: The Basics of JavaScript. Background. Needs for Programming Capability. Origin of JavaScript. Using Client-side JavaScript Lecture 3: The Basics of JavaScript Wendy Liu CSC309F Fall 2007 Background Origin and facts 1 2 Needs for Programming Capability XHTML and CSS allows the browser to passively display static content How

More information

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang WEB SECURITY WORKSHOP TEXSAW 2014 Presented by Solomon Boyd and Jiayang Wang Introduction and Background Targets Web Applications Web Pages Databases Goals Steal data Gain access to system Bypass authentication

More information

Inf 202 Introduction to Data and Databases (Spring 2010)

Inf 202 Introduction to Data and Databases (Spring 2010) Inf 202 Introduction to Data and Databases (Spring 2010) Jagdish S. Gangolly Informatics CCI SUNY Albany April 22, 2010 Database Processing Applications Standard Database Processing Client/Server Environment

More information

Part I. Web Technologies for Interactive Multimedia

Part I. Web Technologies for Interactive Multimedia Multimedia im Netz Wintersemester 2012/2013 Part I Web Technologies for Interactive Multimedia 1 Chapter 2: Interactive Web Applications 2.1! Interactivity and Multimedia in the WWW architecture 2.2! Server-Side

More information

PHP INTERVIEW QUESTION-ANSWERS

PHP INTERVIEW QUESTION-ANSWERS 1. What is PHP? PHP (recursive acronym for PHP: Hypertext Preprocessor) is the most widely used open source scripting language, majorly used for web-development and application development and can be embedded

More information

5. JavaScript Basics

5. JavaScript Basics CHAPTER 5: JavaScript Basics 88 5. JavaScript Basics 5.1 An Introduction to JavaScript A Programming language for creating active user interface on Web pages JavaScript script is added in an HTML page,

More information

13. Databases on the Web

13. Databases on the Web 13. Databases on the Web Requirements for Web-DBMS Integration The ability to access valuable corporate data in a secure manner Support for session and application-based authentication The ability to interface

More information

PHP. Introduction. PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server

PHP. Introduction. PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP Introduction Hypertext Preprocessor is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages. For this purpose, PHP code is

More information

Princess Nourah bint Abdulrahman University. Computer Sciences Department

Princess Nourah bint Abdulrahman University. Computer Sciences Department Princess Nourah bint Abdulrahman University Computer Sciences Department 1 And use http://www.w3schools.com/ PHP Part 1 Objectives Introduction to PHP Computer Sciences Department 4 Introduction HTML CSS

More information

Web Engineering (Lecture 08) WAMP

Web Engineering (Lecture 08) WAMP Web Engineering (Lecture 08) WAMP By: Mr. Sadiq Shah Lecturer (CS) Class BS(IT)-6 th semester WAMP WAMP is all-in-one Apache/MySQL/PHP package WAMP stands for: i) Windows ii) iii) iv) Apache MySql PHP

More information

Programming for the Web with PHP

Programming for the Web with PHP Aptech Ltd Version 1.0 Page 1 of 11 Table of Contents Aptech Ltd Version 1.0 Page 2 of 11 Abstraction Anonymous Class Apache Arithmetic Operators Array Array Identifier arsort Function Assignment Operators

More information

PHP 5 Introduction. What You Should Already Know. What is PHP? What is a PHP File? What Can PHP Do? Why PHP?

PHP 5 Introduction. What You Should Already Know. What is PHP? What is a PHP File? What Can PHP Do? Why PHP? PHP 5 Introduction What You Should Already Know you should have a basic understanding of the following: HTML CSS What is PHP? PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open

More information

Web insecurity Security strategies General security Listing of server-side risks Language specific security. Web Security.

Web insecurity Security strategies General security Listing of server-side risks Language specific security. Web Security. Web Security Web Programming Uta Priss ZELL, Ostfalia University 2013 Web Programming Web Security Slide 1/25 Outline Web insecurity Security strategies General security Listing of server-side risks Language

More information

Lecture 7 PHP Basics. Web Engineering CC 552

Lecture 7 PHP Basics. Web Engineering CC 552 Lecture 7 PHP Basics Web Engineering CC 552 Overview n Overview of PHP n Syntactic Characteristics n Primitives n Output n Control statements n Arrays n Functions n WampServer Origins and uses of PHP n

More information

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010 Lecture 14 Javascript Announcements Project #2 New website Exam#2 No. Class Date Subject and Handout(s) 17 11/4/10 Examination Review Practice Exam PDF 18 11/9/10 Search, Safety, Security Slides PDF UMass

More information

COMP519 Practical 5 JavaScript (1)

COMP519 Practical 5 JavaScript (1) COMP519 Practical 5 JavaScript (1) Introduction This worksheet contains exercises that are intended to familiarise you with JavaScript Programming. While you work through the tasks below compare your results

More information

Web Scripting using PHP

Web Scripting using PHP Web Scripting using PHP Server side scripting No Scripting example - how it works... User on a machine somewhere Server machine So what is a Server Side Scripting Language? Programming language code embedded

More information

Such JavaScript Very Wow

Such JavaScript Very Wow Such JavaScript Very Wow Lecture 9 CGS 3066 Fall 2016 October 20, 2016 JavaScript Numbers JavaScript numbers can be written with, or without decimals. Extra large or extra small numbers can be written

More information

Web development with PHP. Kore Nordmann, Tobias Schlitt, Jakob Westhoff Dortmund

Web development with PHP. Kore Nordmann, Tobias Schlitt, Jakob Westhoff Dortmund Web development with PHP Kore Nordmann, Tobias Schlitt, Jakob Westhoff Dortmund 29.06.09 Speaker Jakob Westhoff Kore Nordmann Tobias Schlitt Active in various

More information

Agenda. My Introduction. CIS 154 Javascript Programming

Agenda. My Introduction. CIS 154 Javascript Programming CIS 154 Javascript Programming Brad Rippe brippe@fullcoll.edu Agenda Brief Javascript Introduction Course Requirements Brief HTML review On to JavaScript Assignment 1 Due Next week Helpful Tools Questions/Comments

More information

HTML 5 Form Processing

HTML 5 Form Processing HTML 5 Form Processing In this session we will explore the way that data is passed from an HTML 5 form to a form processor and back again. We are going to start by looking at the functionality of part

More information

Databases on the web

Databases on the web Databases on the web The Web Application Stack Network Server You The Web Application Stack Network Server You The Web Application Stack Web Browser Network Server You The Web Application Stack Web Browser

More information

Course Topics. The Three-Tier Architecture. Example 1: Airline reservations. IT360: Applied Database Systems. Introduction to PHP

Course Topics. The Three-Tier Architecture. Example 1: Airline reservations. IT360: Applied Database Systems. Introduction to PHP Course Topics IT360: Applied Database Systems Introduction to PHP Database design Relational model SQL Normalization PHP MySQL Database administration Transaction Processing Data Storage and Indexing The

More information

PHP for PL/SQL Developers. Lewis Cunningham JP Morgan Chase

PHP for PL/SQL Developers. Lewis Cunningham JP Morgan Chase PHP for PL/SQL Developers Lewis Cunningham JP Morgan Chase 1 What is PHP? PHP is a HTML pre-processor PHP allows you to generate HTML dynamically PHP is a scripting language usable on the web, the server

More information

Chapter 3 Data Types and Variables

Chapter 3 Data Types and Variables Chapter 3 Data Types and Variables Adapted from JavaScript: The Complete Reference 2 nd Edition by Thomas Powell & Fritz Schneider 2004 Thomas Powell, Fritz Schneider, McGraw-Hill Jargon Review Variable

More information

CGS 3066: Spring 2015 JavaScript Reference

CGS 3066: Spring 2015 JavaScript Reference CGS 3066: Spring 2015 JavaScript Reference Can also be used as a study guide. Only covers topics discussed in class. 1 Introduction JavaScript is a scripting language produced by Netscape for use within

More information

The project is conducted individually The objective is to develop your dynamic, database supported, web site:

The project is conducted individually The objective is to develop your dynamic, database supported, web site: Project The project is conducted individually The objective is to develop your dynamic, database supported, web site: n Choose an application domain: music, trekking, soccer, photography, etc. n Manage

More information

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies Internet t Software Technologies JavaScript part one IMCNE A.A. 2008/09 Gabriele Cecchetti Why introduce JavaScript To add dynamicity and interactivity to HTML pages 2 What s a script It s a little interpreted

More information

Introduction to web development with PHP

Introduction to web development with PHP Chapter 1 Introduction to web development with PHP Objectives (continued) Knowledge 9. Describe the benefits of using an IDE like NetBeans for application development. 2017, Mike Murach & Associates, Inc.

More information

Basics of Web. First published on 3 July 2012 This is the 7 h Revised edition

Basics of Web. First published on 3 July 2012 This is the 7 h Revised edition First published on 3 July 2012 This is the 7 h Revised edition Updated on: 03 August 2015 DISCLAIMER The data in the tutorials is supposed to be one for reference. We have made sure that maximum errors

More information

Master Syndication Gateway V2. User's Manual. Copyright Bontrager Connection LLC

Master Syndication Gateway V2. User's Manual. Copyright Bontrager Connection LLC Master Syndication Gateway V2 User's Manual Copyright 2005-2006 Bontrager Connection LLC 1 Introduction This document is formatted for A4 printer paper. A version formatted for letter size printer paper

More information

New Media Production Lecture 7 Javascript

New Media Production Lecture 7 Javascript New Media Production Lecture 7 Javascript Javascript Javascript and Java have almost nothing in common. Netscape developed a scripting language called LiveScript. When Sun developed Java, and wanted Netscape

More information

Web Development Course (PHP-MYSQL-HTML5.0)

Web Development Course (PHP-MYSQL-HTML5.0) Mstechnologies.org https://www.facebook.com/mindscapestechnologies/ Web Development Course (PHP-MYSQL-HTML5.0) DURATION : 3 MONTHS Mindscapes Technologies Off # 01, Mezzanine Floor, Park View AptNear Usmania

More information

PHP & My SQL Duration-4-6 Months

PHP & My SQL Duration-4-6 Months PHP & My SQL Duration-4-6 Months Overview of the PHP & My SQL Introduction of different Web Technology Working with the web Client / Server Programs Server Communication Sessions Cookies Typed Languages

More information

(Refer Slide Time: 01:40)

(Refer Slide Time: 01:40) Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #25 Javascript Part I Today will be talking about a language

More information

DevShala Technologies A-51, Sector 64 Noida, Uttar Pradesh PIN Contact us

DevShala Technologies A-51, Sector 64 Noida, Uttar Pradesh PIN Contact us INTRODUCING PHP The origin of PHP PHP for Web Development & Web Applications PHP History Features of PHP How PHP works with the Web Server What is SERVER & how it works What is ZEND Engine Work of ZEND

More information

Real Life Web Development. Joseph Paul Cohen

Real Life Web Development. Joseph Paul Cohen Real Life Web Development Joseph Paul Cohen joecohen@cs.umb.edu Index 201 - The code 404 - How to run it? 500 - Your code is broken? 200 - Someone broke into your server? 400 - How are people using your

More information

JavaScript. What s wrong with JavaScript?

JavaScript. What s wrong with JavaScript? JavaScript 1 What s wrong with JavaScript? A very powerful language, yet Often hated Browser inconsistencies Misunderstood Developers find it painful Lagging tool support Bad name for a language! Java

More information

CS50 Quiz Review. November 13, 2017

CS50 Quiz Review. November 13, 2017 CS50 Quiz Review November 13, 2017 Info http://docs.cs50.net/2017/fall/quiz/about.html 48-hour window in which to take the quiz. You should require much less than that; expect an appropriately-scaled down

More information

Application Design and Development: October 30

Application Design and Development: October 30 M149: Database Systems Winter 2018 Lecturer: Panagiotis Liakos Application Design and Development: October 30 1 Applications Programs and User Interfaces very few people use a query language to interact

More information

Distributed Databases and Remote Access to a Database

Distributed Databases and Remote Access to a Database Distributed Databases and Remote Access to a Database Table of Contents 1 Distributed Databases... 2 2 Internet (Overview)... 4 3 Internet-Based Applications... 9 3.1 Server-Side Scripting... 9 3.2 Client-Side

More information

Department of Electrical Engineering and Computer Science EECS 347 Microprocessor System Projects Spring 2017

Department of Electrical Engineering and Computer Science EECS 347 Microprocessor System Projects Spring 2017 Department of Electrical Engineering and Computer Science EECS 347 Microprocessor System Projects Spring 2017 Personalizable Display Frame ver 1.0 Final Report and User Guide Names: Alex Gangwish, Karan

More information

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications JavaScript Started as a simple script in a Web page that is interpreted and run by the browser Supported by most modern browsers Allows dynamic update of a web page More generally, allows running an arbitrary

More information

Some things to watch out for when using PHP and Javascript when building websites

Some things to watch out for when using PHP and Javascript when building websites Some things to watch out for when using PHP and Javascript when building websites Les Hatton 10 Sep 2003 1 PHP PHP is a C-like language which evolved from Perl scripts originally produced by Rasmus Lerdorf

More information

Mobile Site Development

Mobile Site Development Mobile Site Development HTML Basics What is HTML? Editors Elements Block Elements Attributes Make a new line using HTML Headers & Paragraphs Creating hyperlinks Using images Text Formatting Inline styling

More information

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts Instructor s Web Data Management Web Client/Server Concepts Web Data Management 152-155 Web Client/Server Concepts Quick Links & Text References Client / Server Concepts Pages 4 11 Web Data Mgt Software

More information

a Why JavaScript? jonkv interactivity on the web CGI JavaScript Java Applets Netscape LiveScript JavaScript 1: Example

a Why JavaScript? jonkv interactivity on the web CGI JavaScript Java Applets Netscape LiveScript JavaScript 1: Example Why JavaScript? 2 JavaScript JavaScript the language Web page manipulation with JavaScript and the DOM 1994 1995: Wanted interactivity on the web Server side interactivity: CGI Common Gateway Interface

More information

COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts

COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

Options. Real SQL Programming 1. Stored Procedures. Embedded SQL

Options. Real SQL Programming 1. Stored Procedures. Embedded SQL Real 1 Options We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional

More information

CS637 Midterm Review

CS637 Midterm Review CS637 Midterm Review Coverage: Duckett Chapter 1-2: Basics: Can skip pp. 53-56 Chapter 3: Lists: all important Chapter 4:Links: all important Chapter 5:Images: can skip old code Chapter 6: Tables: all

More information

Introduction. Server-side Techniques. Introduction. 2 modes in the PHP processor:

Introduction. Server-side Techniques. Introduction. 2 modes in the PHP processor: Introduction Server-side Techniques PHP Hypertext Processor A very popular server side language on web Code embedded directly into HTML documents http://hk2.php.net/downloads.php Features Free, open source

More information

INTERVIEW QUESTIONS - PHP JOB 2014 (HTML)

INTERVIEW QUESTIONS - PHP JOB 2014 (HTML) INTERVIEW QUESTIONS - PHP JOB 2014 (HTML) 1. Who is the father of PHP? 2. Current version of PHP? 3. What is Zend engine? 4. Definition of PHP? 5. Is html embed in PHP? 6. What is!doctype? 7. What is responsive

More information

COMP102: Introduction to Databases, 23

COMP102: Introduction to Databases, 23 COMP102: Introduction to Databases, 23 Dr Muhammad Sulaiman Khan Department of Computer Science University of Liverpool U.K. 04 April, 2011 Programming with SQL Specific topics for today: Client/Server

More information

This lecture. PHP tags

This lecture. PHP tags This lecture Databases I This covers the (absolute) basics of and how to connect to a database using MDB2. (GF Royle 2006-8, N Spadaccini 2008) I 1 / 24 (GF Royle 2006-8, N Spadaccini 2008) I 2 / 24 What

More information

PHP Hypertext Preprocessor

PHP Hypertext Preprocessor PHP Hypertext Preprocessor A brief survey Stefano Fontanelli stefano.fontanelli@sssup.it January 16, 2009 Stefano Fontanelli stefano.fontanelli@sssup.it PHP Hypertext Preprocessor January 16, 2009 1 /

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 11 Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming Slide 11-2 Web Database Programming Using PHP Techniques for programming dynamic features

More information

Computer Science E-75 Building Dynamic Websites

Computer Science E-75 Building Dynamic Websites Computer Science E-75 Building Dynamic Websites Harvard Extension School http://www.cs75.net/ Lecture 0: HTTP David J. Malan malan@post.harvard.edu http://www.cs.harvard.edu/~malan/ 0 DNS Image from wikipedia.org.

More information

Bruce Moore Fall 99 Internship September 23, 1999 Supervised by Dr. John P.

Bruce Moore Fall 99 Internship September 23, 1999 Supervised by Dr. John P. Bruce Moore Fall 99 Internship September 23, 1999 Supervised by Dr. John P. Russo Active Server Pages Active Server Pages are Microsoft s newest server-based technology for building dynamic and interactive

More information

Databases PHP I. (GF Royle, N Spadaccini ) PHP I 1 / 24

Databases PHP I. (GF Royle, N Spadaccini ) PHP I 1 / 24 Databases PHP I (GF Royle, N Spadaccini 2006-2010) PHP I 1 / 24 This lecture This covers the (absolute) basics of PHP and how to connect to a database using MDB2. (GF Royle, N Spadaccini 2006-2010) PHP

More information

ISSN: [Kumar * et al., 7(3): March, 2018] Impact Factor: 5.164

ISSN: [Kumar * et al., 7(3): March, 2018] Impact Factor: 5.164 IJESRT INTERNATIONAL JOURNAL OF ENGINEERING SCIENCES & RESEARCH TECHNOLOGY DEVELOPMENT OF A SMALL FOSS APPLICATION NAMED TEACHER STUDENT PORTAL USING FREE AND OPEN SOURCE SOFTWARES Sushil Kumar *1, Dr.

More information

Session 16. JavaScript Part 1. Reading

Session 16. JavaScript Part 1. Reading Session 16 JavaScript Part 1 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript / p W3C www.w3.org/tr/rec-html40/interact/scripts.html Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/

More information

JavaScript: Introduction, Types

JavaScript: Introduction, Types JavaScript: Introduction, Types Computer Science and Engineering College of Engineering The Ohio State University Lecture 19 History Developed by Netscape "LiveScript", then renamed "JavaScript" Nothing

More information

Beginning HTML. The Nuts and Bolts of building Web pages.

Beginning HTML. The Nuts and Bolts of building Web pages. Beginning HTML The Nuts and Bolts of building Web pages. Overview Today we will cover: 1. what is HTML and what is it not? Building a simple webpage Getting that online. What is HTML? The language of the

More information

(Frequently Asked Questions)

(Frequently Asked Questions) (Frequently Asked Questions) Aptech Ltd. Version 1.0 Page 1 of 9 Table of Contents S# Question 1. How do you create sub domains using PHP? 2. What is the difference between echo and print statements in

More information

DATABASE SYSTEMS. Database programming in a web environment. Database System Course,

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, DATABASE SYSTEMS Database programming in a web environment Database System Course, 2016-2017 AGENDA FOR TODAY The final project Advanced Mysql Database programming Recap: DB servers in the web Web programming

More information

Chapter 1 Introduction to HTML, XHTML, and CSS

Chapter 1 Introduction to HTML, XHTML, and CSS Chapter 1 Introduction to HTML, XHTML, and CSS MULTIPLE CHOICE 1. The world s largest network is. a. the Internet c. Newsnet b. the World Wide Web d. both A and B A PTS: 1 REF: HTML 2 2. ISPs utilize data

More information

Chapter 11 Outline. A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming. Slide 11-2

Chapter 11 Outline. A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming. Slide 11-2 Chapter 11 Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming Slide 11-2 1 Web Database Programming Using PHP Techniques for programming dynamic features

More information

INTERNET PROGRAMMING. Software Engineering Branch / 4 th Class Computer Engineering Department University of Technology

INTERNET PROGRAMMING. Software Engineering Branch / 4 th Class Computer Engineering Department University of Technology INTERNET PROGRAMMING Software Engineering Branch / 4 th Class Computer Engineering Department University of Technology OUTLINES PHP Basic 2 ARCHITECTURE OF INTERNET database mysql server-side programming

More information

These are notes for the third lecture; if statements and loops.

These are notes for the third lecture; if statements and loops. These are notes for the third lecture; if statements and loops. 1 Yeah, this is going to be the second slide in a lot of lectures. 2 - Dominant language for desktop application development - Most modern

More information

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL.

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL. Hello everyone! Welcome to our PHP + MySQL (Easy to learn) E.T.L. free online course Hope you have installed your XAMPP? And you have created your forms inside the studio file in the htdocs folder using

More information

3. WWW and HTTP. Fig.3.1 Architecture of WWW

3. WWW and HTTP. Fig.3.1 Architecture of WWW 3. WWW and HTTP The World Wide Web (WWW) is a repository of information linked together from points all over the world. The WWW has a unique combination of flexibility, portability, and user-friendly features

More information

WWW Document Technologies

WWW Document Technologies WWW Document Technologies Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@imap.pitt.edu http://www.sis.pitt.edu/~spring Overview The Internet

More information

A Simple Course Management Website

A Simple Course Management Website A Simple Course Management Website A Senior Project Presented to The Faculty of the Computer Engineering Department California Polytechnic State University, San Luis Obispo In Partial Fulfillment Of the

More information

Chapter 1. Introduction to web development and PHP. 2010, Mike Murach & Associates, Inc. Murach's PHP and MySQL, C1

Chapter 1. Introduction to web development and PHP. 2010, Mike Murach & Associates, Inc. Murach's PHP and MySQL, C1 1 Chapter 1 Introduction to web development and PHP 2 Applied Objectives Use the XAMPP control panel to start or stop Apache or MySQL when it is running on your own computer. Deploy a PHP application on

More information

SEEM4540 Open Systems for E-Commerce Lecture 04 Servers Setup and Content Management Systems

SEEM4540 Open Systems for E-Commerce Lecture 04 Servers Setup and Content Management Systems SEEM4540 Open Systems for E-Commerce Lecture 04 Servers Setup and Content Management Systems Prolog To show our e-commerce store, we need to have a web server. There are three ways to obtain a web server:

More information

CS 161 Computer Security

CS 161 Computer Security Raluca Ada Popa Spring 2018 CS 161 Computer Security Discussion 9 Week of March 19, 2018 Question 1 Warmup: SOP (15 min) The Same Origin Policy (SOP) helps browsers maintain a sandboxed model by preventing

More information

INFS 2150 Introduction to Web Development and e-commerce Technology. Programming with JavaScript

INFS 2150 Introduction to Web Development and e-commerce Technology. Programming with JavaScript INFS 2150 Introduction to Web Development and e-commerce Technology Programming with JavaScript 1 Objectives JavaScript client-side programming Example of a JavaScript program The element

More information

Objectives. Introduction to JavaScript. Introduction to JavaScript INFS Peter Y. Wu, RMU 1

Objectives. Introduction to JavaScript. Introduction to JavaScript INFS Peter Y. Wu, RMU 1 Objectives INFS 2150 Introduction to Web Development and e-commerce Technology Programming with JavaScript JavaScript client-side programming Example of a JavaScript program The element

More information