WebProgrammingStepbyStep
Lecture6Introductionto
PHP Reading:5.1-5.3Exceptwhereotherwisenoted,thecontentsofthispresentationareCopyright2009MartySteppandJessicaMiller.
4.4:SizingandPositioning
4.1:StylingPageSections4.2:IntroductiontoLayout4.3:Fl
oatingElements4.4:SizingandPositioning
Thedisplayproperty(4.4.4)
h2{display:inline;background-color:yellow;}
ThisisaheadingThisisanotherheading
propertydisplaydescriptionsetsthetypeof
CSSboxmodelanelementisdisplayedwith
values:none,inline,block,run-in,compact,...usesparingly,becauseitcanradicallyalterthepagelayout
Displayingblockelementsasinline
Item1
Item2
Item3
#topmenuli{display:inline;border:2pxsolidgray;margin-right:1em;}Item1Item2Item3
listsandotherblockelementscanbedisplayedinlineflowleft-to-rightonsamelinewidthisdeterminedbycontent(blockelementsare100%ofpagewidth)
Thevisibilityproperty
p.secret{visibility:hidden;}
propertyvisibility
descriptionsetswhetheranelementshouldbeshownonscreen;canbevisible(default)orhidden
hiddenelementswillstilltakeupspaceonscreen,butwillnotbeshowntomakeitnottakeupanyspace,setdisplaytononeinsteadcanbeusedtoshow/hidedynamicHTMLcontentonthepageinresponsetoevents
5.1:Server-SideBasics
5.1:Server-SideBasics5.2:PHPBasicSyntax5.3:EmbeddedPHP5.4:AdvancedPHPSyntax
URLsandwebservers
puterlooksuptheserver'sIPaddressusingDNSyourbrowserconnectstothatIPaddressandrequeststhegivenfilethewebserversoftware(e.g.Apache)grabsthatfilefromtheserver'slocalfilesystem,andsendsbackitscontentstoyousomeURLsactuallyspecifyprogramsthatthewebservershouldrun,andthensendtheiroutputbacktoyouastheresult:
https://webster.cs.washington.edu/quote2.php
theaboveURLtellstheserverwebster.cs.washington.edutoruntheprogramquote2.phpandsendbackitsoutput
Server-Sidewebprogramming
server-sidepagesareprogramswrittenusingoneofmanywebprogramminglanguages/frameworksexamples:PHP,Java/JSP,RubyonRails,ASP.NET,Python,Perlthewebservercontainssoftwarethatallowsittorunthoseprogramsandsendbacktheiroutputasresponsestowebrequestseachlanguage/frameworkhasitsprosandconsweusePHPforserver-sideprogramminginthistextbook