Document 142

You might also like

Download as pdf
Download as pdf
You are on page 1of 16
Web Technelogy F Msiqnment G! difier. 6 rough a side in detail the texical Shuctuve of the PHP Explain st t the seb of basic ules that gover how one u prego fn that ‘lanquage § cose sensitivity. 3 The names of user defined classes 4 functions as wel! os pusit tn Ranctions QZ keywords are cose - Insensitive Variables oe abo core sensitive. « Statements & semicolons A stotemnent fs a collection of PHP code that dees gomerhing . Tk ts_terminakd by semicolon. - $2 are ured 40 form. compound statemenb ter conte) shuchures. : * Whtiespaces & Line Breaks Whitespace fs used to separate tokens in PHP dt improves readability of source code To seporose out statemenh line breaks are used + Commenls a Jingle__\ine commenh are given by 4 ox /! Multiline commenh are_enclosed within /*---- 23h, * Explain event hendiing in Tavascriph When an event occurs , you can create an event handler which _t . , hich ta ptece of code thot uit! execute to respord . ‘thor event, nN event handler fs also Known as event [enes. dt stems to i Oke i. event and responds accordingly to He , Qs _| Eg, \oaded in te browser, Y, becomes. o- document objec . I+ fs Ha soct ¢ \ snes represents te html document LL hos _propesties ond methods. By + document —obfeck , we con add dynamic Contes y eb—page— aca - ~~ ~The Dorf 2 poogsomming- Sobestate tox A TIAL + and xP documents Tt definen the tagteal "ef _documenb ond te way a document is accoxsed. gad aMani puloted— 2 Ym used to ShtuchireTle_web_pages od ___s used 40 add__behaviouy ta our _weh pager. _ an HTML: Pile ts loaded ?nto tie browses ,_ at _javaseatot can Not -undeskand He HTML cecum 4 directly, So -o_corra pending _decument i, created 4~—(Dom)_. Dom __is_bertcolly tte nreprerentebion of 4 8 4 seme HIME document but tao ditecnt feunet —___ T -with tte use of objec. __ i Representation of Ts Doms LoD Window Obge ~ ~2% Document _Objed— pe BD form _Onjeck._— \ el) Lok Object cE SD_Aneh as) Explain fa detail tte methods wed fo, Shep i Comparisons tn PHP. 4 7 Tn PHP, we can we efther Ha Bos operator 4o compare hoo atringe- se The == operator wil) compare” the values of 4 stings - Return truce if both operands conto; J nN Same values The === operator will compare both the vo! and the type of the _shings-,veturo tue if opexands are of game type —— = _ The: Comparison operatos (4,4: used fox _ shing comparisons. Skemp C) Function 4to_compore: 40 Shings — j 1 Shemp ( ahing 1, Shing 2) —————- tf the: shings are equal. PFDA alse _ghreasecm pC) 28 _ used Fer comparing two given. Shing. Tt comer _ strings do lowercase before comparing. them. return Zero (0) tf both -tie_shings are aual. shncasecmp O # wilgetens 2 ene tee Compare. Pirsk few charackexa_of tte shring. ename = fname: r $this —> edept = $dept j function Show- details echo $this -> ename .” 2 echo” Your department & ".$ thi Pedept; $ employee oby = new Employee (" Rakesh!, “developed )’ oe Oyee- obj ~ > Show. details (>: ee = new Employee C' Vikas "," Manage," ay "Ployee 2 => show cafails (I is. form @ Explain wlth +4 hat fs elf - processing | -help.af — program =| Te we want to Include both form a fe, “handing Feam Aubmissioota-o aingle a File, LoTR form. ty -oflem referred +09? ena iat : hot _yetuar> toe cu farm. 7 : _pHP_SELF_ fa _ventalble- a ret Seria _. beta executed... ‘Tou co0 wie th sama ve Inte TTa_actten_freld of te | Boxer _fashucs— twher€- do ane ab re fee dhode ihe, te “User _prrenses- stig _dubsmnit—bubton— Moat PHP anaiotain — alidation on Te AOMe Proce _ create oSeF = proconsing form Me 4 SERUEE_ | thor _vebuns Here gues — Tov Post —__—-—— ___- For =" Roem)" method =" past” action = Ne echo _hivnlspectalehars C$ -SERUER C1 PHE- SELE ID; 20". Programa <1 DoctyPE hh) 2 ees a _<[beod > [eee Sbady> iE a SO Pipes A a ae = ——Sname = $email = $level =. exo SFC $-SeRver C" AEQUEST. METHOD =), [ee er spots goame > tert fnpur Ch.Post L "name" 1); Semail * testa topur(§ Post L" email"): Sneview = teat. inpur Cb. post Lb review "1; $level + Heaktnpur (h-Past Cleve "1 function. hat-faput ($data) $dala = him C4data)s $data = shipslashes (¢dota); $data + htm\spectal chars( $dasa) 5 wetuyn $datas 3 29> _Sh2? PHP Fever Example 1 GFQ Review fom method =" past" acton= " "2 _ Name _E=mail: Review + Stextarea name = "yeview! vouss"5" Cols= "4o"'> < HHextarea>
2 aoe _4inpur type = “sadio" name = “Neve value =" Bad" > Bad _Ainput type = "radto" name ="level" value=" Avercge" > Average . Good _ £by> : : "s echo $ review) echo “Shr $1 $level 3 echo Sbaattt name ="Qubmit” value ="submib"> te r He comcent _ atte PHP ceniph -to demonstvode Introspection for examininy, abject Slip «cs ¢ Pah = news foro 1 date | te Gt, ote chops) yd Sache: getaplant-tabbiien "9G di ——4 4. A [ee ~ 7h C method exists (Sob, FA) : Hct eg z Fae echo." method fu exh : a _var-dump.( geb-object vars (ob)! ‘ Hos os i pP-8- | Papen elt st aya ingame — - doterfaces alow ypu _ should implement - golerfaces make classea fo tte A to SPecity what methods a class Say to we o Variehy of dtPfeenk aM, Woy, When one or More ° le Ho Same interface , srnapbeal ih ty referred nO. o.n % O04 © pol ymerphism ". doterFaces ane declared usith 7 eee Leith He. tntenPace, key word <2 php inter Peco “nterface Name a public function gome Method! (9; pale Runchion SomeMethod 2( $name, $coler): public_Rundion some Method 30) : Shing 5 Te — i Program 3 po _ interface _ MydnterfaceName § 4 public function methad Uy > public funchion method 20): my ~ Clow 14 CloaName implemenb MydntealoceName $ 4 public Rincien method 1 C)_ } echo" Method | catled’? + "\n" 32 ~— public Rinehion method 2.) 3 echo." Method 2 called "-"\n"s 3 a ee ~S$obj = new MyClarsNomet; + -Sobj => mathed 103 ~ Bobs -> method 20): 8 ‘ } i Waste a pip Program to acceph. hwo -AbingA. Krom ud i +-29d_ chech WhetLoy enterad 2btry are tnodeh: 9 . Dot € Use Welty fom coneepth. | ie pres } i - i a —Sbedy> i ~S fam method ="posk” achion =." Steg Php? | —-SReldset > a ’ ~~ Slegend> Enter Shinga tn in tla sent Boxes LS Hegend> SP> Atak Shing b> ! ">

Ome, Span > Second Shing +
“>

—___ {Beldset 2 : ae Sdiv_aligo = center> Syd al 4 — _< fdiyos Matching " vs _echo." Not Matching Sih" t 4 ft Pa T xe | WA feo CHP Scxiph to accept wennore QD posscond. + df fn to Feat three chonces , urerneme & pos 2 areas py lon apes seca fern, {— __-etttecw, nn nod 1 42 php Posatiem share (3 lie Aine +—i $3 Pe 4¢ 4 sessson font" —feaSegis Scho" torong, posoucd ra ie "+ $ SescToN LE "name" }' Qua, Explatn olext (2, prompt 0 ond ib wn ebe : $c. echo J: eternph: oO § 5 eke . 3 4-sESSSON Cren tT # lt *.§ @> conftam Cd function with example. Alert () 3 Alo alert) method to a virtual. olect box. dt h moat wanning smnensage to Ap dex. —____— a Re abplays on ales dialogue box tak coraists of Some. specified mersage _Cuohich is optional) ad — an_ OK. bulton.. oa Lt seats a “WR synton bt alert C* smersage'), a 4 anaScript fs used to display. j- used to give a prompt 2 - 4 Ta prompt. method tn Tavaseripk fs used te divplay G promph manner prompts THe wer fer te input + ty gqenerolly ured to take tof wen befce sess te, crude meee op> » we hare : i oe a ee ave to chick "OK" ow" Cancel do = Lene Syntax %_ prompt C "message * defaule' + - “ ek ie 1 ten, t t | - K -Sfnput type = Yadto mame = "choice" value = 2 The confiiMC 2 method Ab play o cbinlog a Cancel sen C Conk e 5 wrth A MeErsaje,an OK hilton, and | por _ ote confrym() method -returnx truce € tee a cicked “OK" ottewire Tatse wx confiam C message? , a pinite oa PHP Hat cor. acepk 00 numbew and pestercn he add, &ubshracd muh plicahics and divide | cele: pro cessisg Rev 2. pregram +o crede 8 Alrmple cc _ebody? 7 "> _Enten First Value 2 Select Arithmetic Opeaton 4ib> 4 by>
~Sfnpuk type = radio names "choice" value = "2's Substradion s ~Divioion
. oSiopus ty pe = dubmit name = submit value ® "Glade" ~>S/ 9 ena > <2 php. ; $e 28% TEC Reset ( $_POSTE ‘submit ID $as g post [aL ~db = ¢ pol b'D 1 — Sch = $ port Ci choice 4 ———-_3F (teh aati) i i +———— $e = sat $b: hs ft “i echo “ Addifon = _ — 8 TF C ch + ='2") 7 — ee oe a ee = cho. suhbaction 2 a =F FE CSch i“ = fs ] : mee ge agar dbs— [oom aa ba 3. Mulkipicolion = aot i fe($ch == 4!) a zpal bs 4 echo" Division 2 fo Ue a [oie eh toadege 6 tht) Explain detar eer Bova example. : [ 4 Selection Lists | created with a aldo en . _otow.rauLiple Gecitnh.. T6__exaucce— te “ne cog nized te ymyttiple_valiioa. “tet Th "| browses parsen eo ne processing. ee _need_to_ make ta nome of tu Creld fa tte HTML fournond with C7. . fa a Example © CC, C +t, PHP Peal Now, when te — Submits die Lorn $-GeETL' loogtiager. Al a ‘combats On. “OAR jostead of -ginole abrint ry Th _amoy—conbons te volues fot were seleded a tty Uae y cman it [soon aoe a amg oe 4 €» bastally a steg tat a se ae 3 r “Toads as i 7 7B server can send one ee o____. ~ Pecsisberr cookies memoin availahie beyond te cured ~ browne Zersion and are steed ta a tent Fle Pong cet oops r “| Bach fad tviduol sermverav domain con Atee only Total cookies _pe* (4 exceed 3 Orgesr_coabie size ts A _Keflab Ph a —— étenakie (named, veluol pee £4 demi pi ft Ts function exaciss te cookie aby Prom Se gic, i eu ond crenits...acookle header. ewith toy Pring. os Us vole, ss Example & pars Hime ().+ 60% 60% 2 de expine Ju _ cookie fo dwo hour's d?me.— arate

You might also like