1 / 14

IntroductionToPHP

IntroductionToPHP. Static vs. Dynamic websites A static website is created using HTML pages which have been written in a fixed way to instruct the browser how to render the page. (What you see it what you get). Static websites are used to display fixed information which most often does not need

bud
Download Presentation

IntroductionToPHP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IntroductionToPHP Staticvs.Dynamicwebsites AstaticwebsiteiscreatedusingHTMLpageswhichhavebeenwritteninafixedway toinstructthebrowserhowtorenderthepage.(Whatyouseeitwhatyouget). Staticwebsitesareusedtodisplayfixedinformationwhichmostoftendoesnotneed tobeupdatedonaregularbasis. AstheWebevolved,sitesbecamemorecomplexandwereexpectedtodisplay dynamicinformationwhichcouldnothavebeen“hardcoded”inHTML. Such as: Searchresults Numberofvisitors Userlogin Messageboards

  2. IntroductionToPHP Dynamicwebsites ThesolutionwastogeneratetheHTML“on-the-fly”basedonparametersand specifications. Forexample,Ifauseraskstoseesearchresults,auniquepagewouldbegenerated specificallyforhim. TheuserwouldgetanHTMLpage,butanHTMLpagethatwastailoredmadefor him. Sincethereisnowayofknowingeverypossiblesearchresultforeverypossiblekey word,thefinalpageisbeingassembledusingaserver-sidescript. Theserver-sidescriptconstructsthepageandthenitisbeingsentbacktotheclient. Thismeanthatthepageresult.htmlwilllookdifferenteachtimebasedonthegiven specifications.

  3. IntroductionToPHP Dynamicwebsites Everyclientmakesarequestforapage. Theservercheckswhattheclienthasaskedforandbasedonthatconstructsapage forhimbasedonanexistingtemplate. ThetemplateisapagewhichcontainsHTMLcodeandserver-sidecodethatwillend upasHTMLcodeaswell,butadifferentHTMLeachtime.

  4. IntroductionToPHP ThreeTierWebApplications

  5. IntroductionToPHP BenefitsOfDynamicContent Theabilitytocustomizepagesforanygivenuser. Greatereaseofmodificationandupdate. Extendedfunctionality(login,transactions,communicationetc.). Automatingthesiteandallowingittosupportitself.Lesspagestomanuallycreate.

  6. IntroductionToPHP Server-SideScripting Inordertogeneratedynamicpagesweuseaserver-sidescriptinglanguage. Therearedifferenttypesofserver-sidescriptinglanguagessuchasPHP,ASP, ASP.NET,ColdFusion,JavaServerPages,Perlandothers. Eachscriptinglanguagesisbeinginterpretedbyanapplication,justasFlashisused tomakesenseofActionScriptandhavethecodedothings. Theapplicationwhichinterpretstheserver-sidescriptisinstalledontheseverjustlike anyotherapplication.

  7. IntroductionToPHP Server-SideScripting Server-sidescriptinglanguagesarealsooperatingsystemsdependent. PHPforexampleisbeinginterpretedbyanapplicationcalledApachewhichrunsona UNIXoperatingsystem. Eachserver-sidescriptinglanguagessupportsbasicprogrammingconceptssuchas variables,arrays,functions,loops,conditionalstatementandothers. Theyalsocontainmorespecificelementssuchasspecialobjects,commandsusedto communicatewiththeserverandadatabaseandmuchmore.

  8. IntroductionToPHP Server-SideScripting&Databases Whenthereisaneedtostoreandretrieveinformation(usernames,itemsinstock etc.)adatabasewillbeusedtocontainthedata. Sever-sidescriptcancommunicatetoadatabaseusingastructuredquerylanguage (SQL)whichmanipulatesthedatabase(add,remove,updateetc.) Moreonthatnextweek.

  9. IntroductionToPHP WhatisPHP? PHPstandsforPHP:HypertextPreprocessor PHPisaserver-sidescriptinglanguage,likeASP PHPscriptsareexecutedontheserver PHPsupportsmanydatabases(MySQL,Informix,Oracle,Sybase,Solid, PostgreSQL,GenericODBC,etc.) PHPisanopensourcesoftware(OSS) Thismeansitsfreetouseandisnʼtbeingcontrolledbyasingleentity. Itisbeingdevelopedbyagroupofdevelopers PHPsyntaxresemblesthatofJavaScriptandActionScriptindifferentways. PHPisfreetodownloadanduse

  10. IntroductionToPHP WhatisPHP? PHPstandsforPHP:HypertextPreprocessor PHPisaserver-sidescriptinglanguage,likeASP PHPscriptsareexecutedontheserver PHPsupportsmanydatabases(MySQL,Informix,Oracle,Sybase,Solid, PostgreSQL,GenericODBC,etc.) PHPisanopensourcesoftware(OSS) Thismeansitsfreetouseandisnʼtbeingcontrolledbyasingleentity. Itisbeingdevelopedbyagroupofdevelopers PHPsyntaxresemblesthatofJavaScriptandActionScriptindifferentways. PHPisfreetodownloadanduse

  11. IntroductionToPHP WhatisPHP? PHPfilesmaycontaintext,HTMLtagsandscripts. PHPfilesarereturnedtothebrowserasplainHTML. PHPfileshaveafileextensionof".php",".php3",or".phtml". PHPcanbewritteninanytexteditor. PHPscriptwillbelocatedinsidespecialtags,muchlikeJavaScript e.g.<?php//phpscripthere?> PHPcodecanbelocatedanywhereinthepage. PHPiscasesensitive. EveryvariableinPHPwillhavethe$symbolasaprefix e.g.$myName=“John”; EverylineofcodeMUSTbeterminatedwitha;symbol.

  12. IntroductionToPHP WhatisMySQL? MySQLisasmalldatabaseserver MySQLisidealforsmallandmediumapplications MySQLsupportsstandardSQL MySQLcompilesonanumberofplatforms MySQLisfreetodownloadanduse PHP+MySQL PHPcombinedwithMySQLiscross-platform (meansthatyoucandevelopinWindowsandserveonaUnixplatform).

  13. IntroductionToPHP WhyPHP? PHPrunsondifferentplatforms(Windows,Linux,Unix,etc.) PHPiscompatiblewithalmostallserversusedtoday(Apache,IIS,etc.) PHPisFREEtodownloadfromtheofficialPHPresource:www.php.net PHPiseasytolearnandrunsefficientlyontheserverside

  14. IntroductionToPHP WhatdoYouNeed? Hosting-www.media72.co.uk Youcanuseanyhostingcompanyyouchoose,buttheymusthaveatleast: 1SQLdatabase&PHP CodeEditor-www.panic.com/coda Abilitytotestlocally-www.mamp.info

More Related