0% found this document useful (0 votes)
16 views11 pages

Submt1kd: VTSW, JH VP

The document appears to contain a mix of PHP code snippets and HTML elements related to web form handling and database connections. It discusses user input validation, session management, and error handling in a web application context. The overall focus seems to be on creating a secure and functional web form for user interactions.

Uploaded by

Reny Mathew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views11 pages

Submt1kd: VTSW, JH VP

The document appears to contain a mix of PHP code snippets and HTML elements related to web form handling and database connections. It discusses user input validation, session management, and error handling in a web application context. The overall focus seems to be on creating a secure and functional web form for user interactions.

Uploaded by

Reny Mathew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

I

vn

'\

Web
\

Submt1kd b9
Vtsw~,Jh Vp
Rollho:1t>
LPK02 J {Sol-:;

-------------
I~
~ Oesr9n ~ H1t"'L /;,m In errle1mtJ .c. no: bJ · dlic rAIU. wnk {{' Pt/P a,dt
tc> d,splu~ a mutCl{fl tnd,ralmg, whadJ.t1 J/,z nu: u .., v, / -rn /' whe,n c6,Jtny
on dlic .J'<Abrn,l buHon. (6)

Ani: <li+mJ>
~ht&1J >
L+rtl,) No:..chic/(,r:3-Rnm</l,Jlt)
</hw.d>
<boJy>
<hi) Fnlvt- &-\ numbt:-t : </h))
<kl'() adrm= "chiclt..Nrtimm.php'' m«fhrd~ «posr''>
--<It,lixJ cfor = rrnwmbu /Vumhu :</la!xJ>
11
)

<rnpid 1lJP'=- "nurr,JM'· ,d~''numhu'' nvmt =- "n11mb,,,, r nyuoea'>


~br)<br>
<mpul -lypi=':rubm,J'' vcdLu.:':J'u~m,i">
</r!urm>
<';&,da>
~/hJmJ;>

ch2ck._fv'o~rrnm. php
< ?pnp .
If (J_SFI? Vf R["RliGWST_fY1f1MOD:}:= ''(JOS1 '.)
f
.J num., =I- POS1 ['num!u!);
if (In"'?')""> o)
f
J echo "1h, no! 4num D poJfftvt. '';
e/strf (!/nurn< o)
[
J ~
rho "·n L.
11,c humfJf.f Jnwn t3 'flCJuhvz Y;
~if
t>cho "'Th, no; 1J 2uo.'1 ;
4
J
J
.
')
~ W1,I, a php <Po1m hcmdlmy /J8m d·o pwh,m dlit US'1 YtfjrJluuAon ~I
Qfl~ {)lbbsth wrdh Cf m,n,mvm ~, s dcHa,nnt a,ddJ ~lnl'f/)J J/,t. dCJla Info
cc /fl¥ S6L 1obk af!VI estab/ 1rhrny n{(uscn-g' connah(fYIJ w,dl, di,, duluban.

,1ru! .( h1tnJ >


<~tctd>
<1dlt) Piea-rfo1m </!,tit>
</ha,1.J>
<body>
<h1;> P.t[ftsfrtilhn Fo1m </hi>
{lcmn o.dron=-?lqpJM.php'' muMod:: poiJ'>
<labtJ )f/rAmc ~ </lalxJ>
~ u/: •c ~
lnp - t&rr=hxt 1d=rham," namt-=l'fJome'' n7w,c,d>

<lnhcJ >Fma rl : L/lab,J>


<(rnnul ·h.1n, ~ q'em,., I
Id=ft,i-murI
11
II
,, '(}, . . - .,, nctml~ 'emu,/'' -rcljurn..J>

<lo.btJ >Vovmtlmt 1 ~/lt1biJ>


< tnpt.tl 1fjfl ='tut • id= "&,1.sClfnflrrt,'' na71X, --• W<mlm< " 7Uj,() nJ)'
<~~J)Passwv?d:</~kJ>
<mpe,J 1/jfle 'pw r,,/1/J • td="pWJ,,,.,J' Mme: P~mvl/P • ?ij'""°'>
<Iahd >PnrJlJl /llrJ: </lt1!,<,A) ·-
<input tt;rx-~ "it/• 1d:pbP11Jt' ntrmc= phoPC" t-c,yurrJ>
<:fnp··IUl! ~m r, ,I t r1 ·~ I
V''-:;- STAom, VUA(Jt:: .trP.ty1.Jlu,, >

</furn:>
<!Sudu>
~/6/tflJ.>
~ulvt.php
<?php
4J t,11/(lf f) Crm( : I( ( 0( al!wJ} r,,.•
IUJ·flln cm>< :: •root '';
I pa!SUMti O It /I)

Idbname ~ rr wor_ rfa/fi<P(,{Ji '' ;


/ronn =mw '?!}syli {I suvunumt i$ vsun~1 !pusswu,r/, ldbhumt);

1( {Jronn -> ronnttLuroi) I


die ("Cormu1'ror> fwltJ: "• #conn-> cannuLe,ror);
1
If (I-SBAVcP.P11ieQv1:sr_tY1fTHOP9 ;::-~ "posr'') f
I $name ~I-Pos-1 ['narm0
IJmcul ~ I-POST['cmCIII 'J:
$Wu ncmc =4- po.rrfrA t(,,I ntmt Ji
¢pa.ssc,rrr,J.= paSI(Af(lrd_ha.;h (I-Po.sr{' pwscw,ilr /JQJ'SWoR o_l)PFtlvL T):
$ phon,-= ef-Posr{'phont '];

/iyJ = rr/NSJJP..T (NTO · t:ASC11 {ncrm. 1 Z-mc,f1 utr;,ncrm I puql(Mdl phone) VII lflPS~
('Jn4mz'1 'l?mr.ul~ '4usunomc'/ 'lpaJ.Jwwd', fphont~";
If (lconn-,ro.vrg(lsyJ)=== 11Wf){
" echo rr Pitgislvraflcn J'UrcuslrM ";
JdJ< f
fcho If Im,,r : " 1 l.rr;J. "<b1> •. $ronn-, eiror ',,
J
}
4c onn-"Jdos1, CJ;
~>
"}ys rJ) d~bein
CR!l&Tf 0ffT{)rJfJS£ US(/(_dahb4Jt i
usa us(/1'_ d«lub(JJZ;

CRMTF TflOLE USVJJ(


td tNT(,i) f)()10_ //\ICP.t11§NT PR1tvtl1AY KF0
l'>CAl1>t 'vllP.t HtfR [100) tvrJT NVU J
~Thetd VRR(nflR {rov /VU7 fv(J.lL I
f.fSG,nCh)1, 1/IJR(l/flR{SQ) N<ITWlL,
pw;w14J ve~t lflJ 11 Os{) Ndl/l/Utl1
pho-nt 'vnnc f1f1 ft C,r) tV<lf flJll IL ip
);
~ wbtd fl cookit ? Now rlou PIIP roppa1l dhr. tvnup} of coo/rrz1. {j.)

• A cook,~ n a smetU p,u t of dccip J/(l)iJ tm C( ci,(A'I', Cthnp<Ak,, "8 u


web b1owrt-1 cvh,lt brvwJrn..9 o cve,b1dt. ,l IJ tAJui 1o tc.m,rnbe1 ml, n a/;oJ
cJ/lc CAJ<A J'(Ath uJ Jofl'? crrdendtuls I rm.l-e-fl.ntc or JCJ'J/()n 11/tA?ltnw t?- rh-ul/11111~
- pttp cues dhc .rdcooJt,e o ,/i,",n J-o rrtaJc Ct coofr,t, 7hr, furf) · muJl h, caJl,<I
b<fc.rc Clnlj f1Tfl1L oulpu11 ru coo/f1t1 Clrl pfflt · of dhc 1t11P f>tudt;.

-111 : <? php


SlCcool<rc (ttusl1nernl \ "'V,3wry,dh ", 11mc o t { ld-1-oCJ II J~ "I:)
?)

~ W11rk a Slmplt ronn.,,, s,o,pl fo mul1t o. corm" 1o /wyJal ev,.c/1, Pff P.

h.f: <? php


$HJ>wnam<. = 1
'JoraJh0;1/ ";
ti Cf ,,
yU4l-rnClmc :: v,swu ;
/pwJv<ft?J =- ~ l 2J 1 ,, ;
/ dbnrArnc ::: rr /}(mo_dD.,,;

t/ Conn :: nwJ m;py) i {fJ'e,rwnritm/ /JXSvrnamc /pruswwfl / I dbf"XATflV;


,1

,r (;conn-> Connui_eprn)f
di< t'cOY)na1hm ~rial: ''/ ¢conn -:>Connu,,Lerrvr);
3
~cho ,. tonncJuJ. Jr;tcc/;Jfffidy'':,

)
?r

tg),
V whcd k\ a Plff saJ1on I c?xplt,dn how fo 6'-cnL m orldy ~ dulrvtj &"aster, vrmu/;J,J
(JJ1Jh c?xcmplt. ?
AnJ : A Pf/P <ftSfldn ti a OJo.9 flJ .iorz tnlr" (m vr,,m11,bk) atr'ffJ5.J r,,ult,pk
pt{ yis of USlr's b;oW11 n9 ;tJSlon, unhfic. tooku , stss1,m dtVll ti Jforul on
c;)h, si1v111 J ti 1dcnlt~uf by " ()ntyue otJtton ltJ d!ud. . ti pa.tJ<4 b//,11 JIJ,
sc.,,vC/1 l: Jlit c/,cnt { u1ulfj tlfrMr/ 1h () Coolrrl 01 pwud vrfA VRL].

18 ~ J ~ o:__11rhmg !:!:!.,Jh J!hP S'!!.'!!2·


j::

Q) sf cn1 !_( f!IO n:


- &M you cun (.LS< sesf/on iii PHP, 9ou rmut sfool di,, ,e,JTm (.1JJ119

JJ,c ~eJS 10-n_stcrit cJ tun".


_ Thtl fun" murk bt caJAitf hJ7ll' ona H1rnl or oulpci 11 anL fv
Jh. ~fH.tv,.

~1php
Se .>1)1 on,..Siet1 l o ; i1 t VJS<NtlJl, ,
4_S£SSIOtv ['usun(Jr>tJ:: 0 - / .jf
4_sB.S,ffON ['email'] = 'v1swu.@fjma,,/J..'()1r;';
<.?
G,v floci,fg Sc,&'J'(Dr) YCtYntvbfc :
- On ci dhc .f'iloton ,s J1c,nrztl lfO().. (Cl?I mod,& Jhe. ~ssron Yrm1ai1c.1 Ja-11
D'?f 1l8.fftgnmtJ dhcm.
fi8 : ~7 php
CiDf 1m _sfvnl CJ;
J_ SflJS ION[' wu nurN,'J= 'J dh 1
1,4
1
;

?)

Qf/J ~ng ~ oi!J1dY) I

.. un5t/:r a. Jf(,crrfcc olf!lcn 'fcdl()blc ' - 01Jlnru dk enhrt tf~JJltTn

P~f .Cr php 1


ff1: <:php ·
8lrJtflY2.o!vnl o ' . t'l5Jl<l,U/vr,Jt;
I
Un6CC C1-SilS!ltJtJ0emt11!J); I !"US(fJYLdtJhffjCJ;
?> ?>
\
f:xpJC1,'n CAQA1f ,IN"!G.P.1 c J11,Ec1 optA" on mysy.J -lablt ()ltdli :?xc,mpk { 0

(!) CRfflTf fub1c :


71>< cnuh of-~m(/()l r~ c,ucJ lo cnuh a t>lW t«blt ,fJ dli<- tfa/ubf,l,Jt
§lJnEX : cnen7f 7t,0LE 'labkmcnn, {rolo1.1mo1 r/Jtdu,z-/ rolu11 2 c/ulu4tz, ..:)
f(1 : CAlrfi6. 7tTGlf dcdmf1 [ro ,err P11m(Jrl,!J k,!J/ /lfcm( -~chvn{Jv~ Ayt Inf,,
(nrwJc C/fflR. (t});

Qi) INS run INTO :


'Tht 11l8Vlt ofc,cPvmvnl /J asul fo -JriJVJJ dufi, ,n~ dlic fahlr.
syntux : tNSotU ·wro ~blc_ncrm. (calu ,/ ro/u-,,,1- - ) VPLvC.1 (vu,l,ut '" valutJ,, ..);
f8 : trvsonT trliO ufwicml (101Nrirr</frje / G,wf;} VfJl v1!s (,/ 'vawA ,/ ,~ 'IJ ') ,,·

~IV S9t..N 7 :
1}ic. s,iocr sJe&tmtflf rj cuuf f" n fr,~vi dolt,, rfwm rll,, fablt
~c,~ : srn·cr rol(Jm1 1 £ofu»2 1 - • . /RQrr> 1C1b/ct1mi W11tP.JJ rmdi/lvn.;.
ffj : J1}l fJ CT /V{)/r(1(.I !18' r/rum urw:imtJ e,J-l{ln Onude = 'II';

I~
~ . f.xpluin OVIJ rrx s-J-rmy lwnd/,r,8 r;ft1nch.m wtr/. 1n ·PttP ()Jfr/h c'~ompl~ (U

(1) Jfr/in O :
7h1) Jun" nh,,rr,-,1 dk no : of cno1 HJ ti dn, UrA 1nc(1,t/in,1,1
v J'fU((d

f3:
<J php
/srJr-=- ,, }1ef/11i cvr,nll" ;
echo JV1len(lsh); 1/IJ

[t,) sir_ np(ua () .~ ~,-lrJ


11 ' u, ,, 'Y7
.P(J,....'1 r"' '
•<-,-11)}U vw - l,(;4,'I
'"" v..,(,,., n,1.,.,,
v...,,v,,,c, or.a e< rpa,,,IJJf L Jt/n,u
£.,_/ J'CW-Cr,

wrdh cmod-kt Jf/r,ny_ v


0g: <'? p>,p
t_fr..K,} = tr / 1111 Vr.SWt< 1' ;
ltxlf. = sfr_ npfuu {' VIJWffl'cll, 1
I~ IrVtJWCI (I/ llo,i};
cch o llx!JPI at, ;
?)
(iiO subirlr rJ :
'Jh,) {uncn.rn ?dUY}J Cf po,rJ,on c,I dAt J{nng busr.J on olc 1prctf1d uletih
pcmlt<m 1-- ~ nydh.
(l.o:
u <?php
/i(lcf =1tHello, wuld •i
Pc/10 a/J..bsh {/lo.b 11 s) J I/ r,uo,I/
?> I

Qv) sir /blow C)


C1

1h ri J't1n.,, ron~wb wl chcn, lij r,1 ir/7"1.!J 1o .iowvrt"'11-


.( 7 ·php
Jfat :: rr Hello, WbJ /J '';
cch o JI/ 1/o/owr.1{{lt1<f); /I Wo cwdJ '
J>
('1) sfrfOUfptA CJ :
7h rJ rfant> {ur, Vl/lV all ch(lt>(;t/u 1-iJ CA ufmy lo Clpp,,r( fJ I~

<7 php
4'tocf :: rrhcllo 1 ()1()11</ ''
echo crlrloupptt1 {ci I~}); /fELtO/ ~ -
??
(v!) trtrn cJ :

1h11 {irvtrlwn r'J u;c!ar v.t.0 rc.movi -· L h.,..,,, · rJYm


rfhl wnr,'-1Jru&1 .I! bodh 11J, ()! .,n
<r"9 rm ff

Hy'.
C?php
/iod ~ ir ltdfo1 ~ '' ;.

I f:r, mnvJ1t1cJ := 11/frtl {ilo,J);


echo Jtr,mn«l7e,J ; /kl/~ Wl"lrl.
J)

I 'v w. Wow dou Ct P//P Cl1f0,J dcl/111' 1'mn an army l>i [? l,JL d/t dillt,ml
I o.ro.;p rlo cncth on ar,uy In /Jf-lf cvldl> cm ee:. 6xp/r.dn a'f/J f rfc,,, dltuJ.
~ daw wufh PMP =11 (IJ
-
Ans: .fun" PHf C
s,J~ on{y · i11»9I,
1arx f'kx,bcfdy rt ran Jk,n rn,xc/ drJalifZ
r>Bncrm< .niz dtfnc,m1t It> SUl
r(ixtd 1Q s121.

lndumH (t r,m nc»< bcxlh )IUrrt:,1/C


It rem havi on~ namtnc
Qnd aJJoc,u/tvt 1ndoc 1nd,xtJ'.

/)'l(,11Klt'} mo11ynw! rt. hurJ/t m/ni ar.do"""1,aJy pymv, mcmfJ-eJ rr>tm(// y.


~

f HP c«ll{!j cftln11
--
(,) arra1:1_ mq,tjt CJ: /l'l<fryt ~cv() cm-uyJ
I QJr'fj I= ['applt a;
,I
/t11r'1!J2;;; [' 0Tr,mff! 'J;
./?£SUit :: cnr"1f. rn<IYff {ICfTl<fJ, / rfcnrnyi>:,
QI) 9!!._ug-pu;'ry n :11JJ ;iimttrdr fb rJh,. encl. ol -qn crr"Cf!J
C!11Cl8- pu/h{lfruds/ "ff11pt. ");

([u) a1rtt}-Popc;~ Runoi/4 dh~ las~ c>hmcnt frm ~ em,p.


ff(,lfh -:::.cnm9-pop (/f',u,fr);
Qv ~b'~) : chair ,f Cl val"" cxtfJ J}J an CffPfJ-.

It {r'L o,m,~ [rr/J.maoa'~ frfrtJr/v) [. · · ]

lJurmy dlte (rYliCo.u ol fcfchrny


evvb puyr, ·1>lJn1 a CNpP Slfi'nr
Ct
1V a c//lnt 1nvwtll1, aJ. 0;hcd pom! dotf on tmbcdrlcd Pf/P Jlt,rpJ gz-l
II

I! ?1,u,Jil. whCJ/. cM., dhc .fwo 1ni0Ju dhal Jlt Pl/ P tnou-JJ~J optmJe II) 7
II
8:x.plrJ1'/J.

G) (or(}pVJnd -Lml ln!iiuu {a ()hloJ, !

- vic.d l'vr : Pit1nnrmy PtJP scnplJ ti,rzd~ 1n dk (rnr/. /me/ oulrtlc fJI- Cl cu,/,
bVYwr ~ r, Vt rvm t nl

- p1,11pvJl : 78ptcul(tJ wed l'v, ios)u like tunnm~ Jchrluclw Jtnph, I <l«lll
prvcus1n!J/ 01 dwvl()pny rm,~nJ- .Im, OfYJ/ln
-!9 '. ~hpJ'tr1[Jt..php
(ru web irc--,vt11 morl, :
- Clscd /111 : (1HJCIJl/n~ p11p ,rurpls i'mbitlJcl rn cnb putfll ie,Wlf·t[/ a
r.vibsuM rJr/(( apucl,e (/7 NtJ"'-9·
- pc,nposc.: php cod, 1) ~><trulul whf/n tl c{,"nt 1cruui1 a,.php
!,h f,vm clhc cY111t11tl/ and rlk ?oulJ tJ &ln f hue.I 10 dAt
b1l)~fU Cf.J /lltnl,

, E'xompc : whm 'a brVWft1 ?7:ft4 em ~ P(J!fC .Prhc lrJfp;/kxllmp}t.t4KJ/


rMc php tole t~ flHIUrJ~tl ~ ,fl,., IW'WI, r,,r>d Jk_ ,,,dt.K.ph,,,
H7/>'lL ntu It o 1du-ruf.

l~ b/w
,9 Wh~ (J php (ons,dtrid io hr. dyncrm,cc-dlJd ~8pc/? Dulrh9,,u·h Implode
cmd c::.(.p/odt fan'> JiJ php (),tdh sa dohk ~Jlcmplu

AflJ ~ PHp ~ tJ (c!Y)Jtdtmd as cl9nem1(td/.y 1f)Ptrl ba r,ad lo d(clm elk lpe


of vonublt . php !?au"" or,J_ Jh, rf!Jllc, burcrl on rlk vtlluc tUll!Jh -ltJ rl..
- No ~ de, cf en Jtrm na,Jtrl: wi ccu> ()Ss1yn O'ncJ vrdv,,c .. f o a C/Pr>,u/JJ~
atJi emd php a 'llvrna/lrcd!:J c,nd(/(Jhr,JJ tl.r fypr .

- flwfomolrc ftp C(f()Vl/11 tun : PHP M)vrr;lJ 1ype,1 wh,n nurfcrf


- Tnc. typu arf- C( VCmrP'bl<, rnn c,h,wn!f', OJ di,(, '(lfjm )'(Jr)j

- php a/.),ows dclf f(!Pu 10 Ix usc.d fvyid/,(/).

0) lrnpf odl cJ

-• urnbnn cm,o,g eluncnfs - mfo on, IJ'!rm!J


• usrJ. rt whc.n we. iumt h tum an arrujj m~o a. J-mg}c. sfrrn:J/ lv,dh cc _
Sptcrhicl ~fWJv/vt b/w dhirn.
syntax~ rmp}odt 01 rm::J lsirntAlvrI Cl'>UfJ ,tr:.rn-ui)."i,lmy.
rid: z? php
¢a~~ [tApplt; KB/Jctntf)i" / ttihory t]
f/slrrna~ tmp/odc CIC/ ,, ,,,/C11rfJJi) _;,
echo !hlmg ;
J)
C, 1) H:xp lode c1
- Bnulo a srfrrny ,do on f!Am19
- Urui Ol~n M want 1a bruAA a .rlrmy ,nl() J'lnrdJth pc,r,lr,, buful t1n
a· spcrln def, rnc/v, 1 Jh,n, J/..01, 1wnl;1 10 an t.rmfj.

38 mat, : DAplod,(.sfrn1:1 Jdthmvk1 .Jlrm,!J ln,,nr; / 1nh //4m,l :: f-Jlfp_ ,~r,._ ;n11Y) :
cmwy
fXCin?pl( : <? php
f.rlrmg :::- tr;/pp)e1 Bimunt..11 chr;rry '';
I Olt'rtfj -= 2xplod, ( ,<, ''1 / J1mti);
prn1k_1 {t_~);
?/
~rJr;J : 111110 ccoJ-) IJppJ,
[, J ~ Bon-w.11
{? 7 ~> cfwn9)

\J

You might also like