Presentation is loading. Please wait.

Presentation is loading. Please wait.

Enterprise PHP - Introduction Enterprise Client-Server Development with PHP Nic Shulver, FCES, Staffordshire University A fifteen credit module based on.

Similar presentations


Presentation on theme: "Enterprise PHP - Introduction Enterprise Client-Server Development with PHP Nic Shulver, FCES, Staffordshire University A fifteen credit module based on."— Presentation transcript:

1 Enterprise PHP - Introduction Enterprise Client-Server Development with PHP Nic Shulver, FCES, Staffordshire University A fifteen credit module based on server-side PHP scripting, security, data access and business-relevant development skills. One staged assignment worth 100% of the marks.

2 Enterprise PHP - Introduction What is a server? File server – file: networked file space FTP server – ftp: remote file space, often read-only Web server – http: web pages and more Mail server – mail: email system News server – news: newsgroups messages, used to be huge

3 Enterprise PHP - Introduction Web Servers Web servers used to be very simple: – Accept requests for information, – Respond with static HTML pages and graphics. Servers can be “asked” to run “service” programs Originally called Common Gateway Interface (CGI) applications, now largely superseded by faster, better integrated solutions

4 Enterprise PHP - Introduction Static HTML “http://www.fcet.staffs.ac.uk/nas1/links.htm” This reference asks the server (fcet) to look in the (shortcut to the) nas1 directory...... and find a plain text file called “links.htm” The simple server knows that.htm and.html files are HTML It sends the files, without much further processing, to the browser [n.b. images] More complex servers can do much more

5 Enterprise PHP - Introduction Dynamic HTML “http://fred.co.uk/scripts/debug.php” This reference asks the server (fred, a commercial server in the uk) to look in the (shortcut to the) scripts directory...... and find a file called “debug.php” The server knows that a.php file is a page with embedded scripting and must be run by the Web server software in a special way Output from the PHP engine is sent to the browser

6 Enterprise PHP - Introduction Many languages available Modern: PHP (.php), VBScript or JScript (in ASP,.asp), ASP.NET (.aspx), Java Server Pages (.jsp), Python (.py) and many others Old CGI: perl (.pl), C, C++, any “normal” programming language (.exe)

7 Enterprise PHP - Introduction PHP PHP means “PHP Hypertext Pre-processor” (sic) Originally it was known as “Personal Home Pages” but that is poor for marketing as a business solution It was also called “perl Hypertext Pre-processor” but PHP is no longer just a web-version of perl The PHP language is a mixture of C, perl and others PHP is supported on many platforms (Mac, PC, Linux…)

8 Enterprise PHP - Introduction PHP – print all server variables <?php phpinfo(32); ?> This looks suspiciously simple! PHPinfo() is a built in function that reports all sorts of information The “32” tells the function to show us the values of the server variables

9 Enterprise PHP - Introduction PHP – print all server variables PHP Variables Variable Value _SERVER["ALL_HTTP"]HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:en-gb HTTP_HOST:fcetdev1.student.staffs.ac.uk HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;.NET CLR 1.1.4322;.NET CLR 2.0.50727;.NET CLR 3.0.4506.2152;.NET CLR 3.5.30729;.NET CLR 4.0.20506) HTTP_UA_CPU:x86 _SERVER["HTTPS"]off _SERVER["SCRIPT_NAME"]/wwwdata/nas1/DSAtest01/info.php _SERVER["HTTP_COOKIE"]no value _SERVER["AUTH_PASSWORD"]no value _SERVER["AUTH_TYPE"]no value _SERVER["AUTH_USER"]no value

10 Enterprise PHP - Introduction Raw data – “URL encoding” Information is sent from a form to a script in a very odd format If field “name” has the value “G Singh”... and “job” has the value “principal lecturer”... the script will receive the string “name=G%20Singh&job=principal%20lecturer” But PHP splits this up for you and makes it easy to use, so you don’t usually worry about it

11 Enterprise PHP - Introduction Summary There are different types of server We have discussed the reasons for needing dynamic output … and contrasted plain HTML with dynamically created content We have noted the wide range of scripting languages in use on the Internet … and looked at a specific language, PHP We have briefly considered standard URL-encoded parameters

12 Enterprise PHP - Introduction Links Common Gateway Interface (http://en.wikipedia.org/wiki/Common_Gateway_Interface)http://en.wikipedia.org/wiki/Common_Gateway_Interface Apache HTTP Server (http://en.wikipedia.org/wiki/Apache_HTTP_Server)http://en.wikipedia.org/wiki/Apache_HTTP_Server The Apache HTTP Server Project (http://httpd.apache.org/ABOUT_APACHE.html)http://httpd.apache.org/ABOUT_APACHE.html MS Internet Information Services (http://en.wikipedia.org/wiki/Internet_Information_Services)http://en.wikipedia.org/wiki/Internet_Information_Services The Official Microsoft IIS Site (http://www.iis.net/overview)http://www.iis.net/overview

13 Enterprise PHP - Introduction Links PHP (http://en.wikipedia.org/wiki/Php)http://en.wikipedia.org/wiki/Php PHP: Hypertext Preprocessor (http://www.php.net/)http://www.php.net/ MySQL, one of the world's most popular open source databases (http://www.mysql.com/?bydis_dis_index=1)http://www.mysql.com/?bydis_dis_index=1


Download ppt "Enterprise PHP - Introduction Enterprise Client-Server Development with PHP Nic Shulver, FCES, Staffordshire University A fifteen credit module based on."

Similar presentations


Ads by Google