ip lab (2)

Upload: nivitha

Post on 13-Apr-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/26/2019 ip lab (2)

    1/65

    Ex No :5

    XML AND DATABASES

    PARSING AN XML DOCUMENT USING DOM AND SAX PARSERS.

    AIM:

    To Parsing an XML document using DOM and SAX Parsers.

    ALGORITHM:

    Using Dom:

    Step1: Get a document builder using document builder factor and parse t!e "ml file to create a DOM ob#ect.

    Step $: Get a list of emploee elements from t!e DOM .

    Step%: &or eac! emploee element get t!e id' name' age and tpe.

    (reate an emploee )alue ob#ect and add it to t!e list.

    Step*: At t!e end iterate t!roug! t!e list and print t!e emploees to )erif +e parsed it rig!t.

    Using Sax

    Step1: (reate a Sa" parser and parse t!e "ml

    Step$: ,n t!e e)ent !andler create t!e emploee ob#ect

    Step% : Print out t!e data

    CODING:

    Empo!""s.Xm

    -"ml )ersion/01.0 encoding/02T&3405

    -Personnel5

    -6mploee tpe/0permanent05

    -7ame5Seagull-87ame5

    -,d5%9*-8,d5

    -Age5%*-8Age5

    -86mploee5

    -6mploee tpe/0contract05

    -7ame5;obin-87ame5

  • 7/26/2019 ip lab (2)

    2/65

    -,d5%9

  • 7/26/2019 ip lab (2)

    3/65

    B

    +& G"' a is' o, "mpo!"" ""m"n's

    Get t!e root6lement from t!e DOM ob#ect.&rom t!e root element get all emploee elements. ,terate t!roug!

    eac! emploee element to load t!e data.

    pri)ate )oid parseDocument=>?

    88get t!e root element

    6lement doc6le / dom.getDocument6lement=>

    88get a nodelist of elements

    7odeList nl / doc6le.get6lements@Tag7ame=06mploee0>

    if=nl / null EE nl.getLengt!=> 5 > ?

    for=int i / i - nl.getLengt!=>iFF> ?

    88get t!e emploee element

    6lement el / =6lement>nl.item=i>

    88get t!e 6mploee ob#ect

    6mploee e / get6mploee=el>

    88add it to list

    m6mpls.add=e>

    B

    B

    B

    )& R"a(ing in (a'a ,#om "a)- "mpo!"".

    8

    , taCe an emploee element and read t!e )alues in' create

    an 6mploee ob#ect and return it

    8

    pri)ate 6mploee get6mploee=6lement emp6l> ?

    88for eac! -emploee5 element get te"t or int )alues of

    88name 'id' age and name

  • 7/26/2019 ip lab (2)

    4/65

    String name / getTe"tHalue=emp6l'07ame0>

    int id / get,ntHalue=emp6l'0,d0>

    int age / get,ntHalue=emp6l'0Age0>

    String tpe / emp6l.getAttribute=0tpe0>

    88(reate a ne+ 6mploee +it! t!e )alue read from t!e "ml nodes

    6mploee e / ne+ 6mploee=name'id'age'tpe>

    return e

    B

    8

    , taCe a "ml element and t!e tag name' looC for t!e tag and get

    t!e te"t content

    i.e for -emploee5-name5Io!n-8name5-8emploee5 "ml snippet if

    t!e 6lement points to emploee node and tag7ame is JnameJ , +ill

    return Io!n

    8

    pri)ate String getTe"tHalue=6lement ele' String tag7ame> ?

    String te"tHal / null

    7odeList nl / ele.get6lements@Tag7ame=tag7ame>

    if=nl / null EE nl.getLengt!=> 5 > ?

    6lement el / =6lement>nl.item=>

    te"tHal / el.get&irst(!ild=>.get7odeHalue=>

    B

    return te"tHal

    8

    (alls getTe"tHalue and returns a int )alue

    8

    pri)ate int get,ntHalue=6lement ele' String tag7ame> ?

    88in production application ou +ould catc! t!e e"ception

  • 7/26/2019 ip lab (2)

    5/65

    return ,nteger.parse,nt=getTe"tHalue=ele'tag7ame>>

    B

    (& I'"#a'ingan(p#in'ing.

    pri)ate )oid printData=>?

    Sstem.out.println=07o of 6mploees J0 F m6mpls.siKe=> F 0J.0>

    ,terator it / m6mpls.iterator=> +!ile=it.!as7e"t=>> ?

    Sstem.out.println=it.ne"t=>.toString=>>

    B

    B

    UsingSax:

    SAXPa#s"#Examp".$a%a

    a& C#"a'" a Sax Pa#s"# an( pa#s" '-" xm

    pri)ate )oid parseDocument=> ?

    88get a factor

    SAXParser&actor spf / SAXParser&actor.ne+,nstance=>

    tr ?

    88get a ne+ instance of parser

    SAXParser sp / spf.ne+SAXParser=>

    88parse t!e file and also register t!is class for call bacCs

    sp.parse=0emploees."ml0' t!is> B

    catc!=SAX6"ception se> ?

    se.printStacCTrace=> B

    catc!=Parser(onfiguration6"ception pce> ?

    pce.printStacCTrace=> B

    catc! =,O6"ception ie>?

    ie.printStacCTrace=>

    B

    B

  • 7/26/2019 ip lab (2)

    6/65

    +& In '-" "%"n' -an("#s )#"a'" '-" Empo!"" o+$")' an( )a '-" )o##"spon(ing s"''"# m"'-o(s.

    886)ent andlers

    public )oid start6lement=String uri' String local7ame' String 7ame' Attributes attributes> t!ro+s SAX6"ception

    ?

    88reset tempHal / 00

    if=7ame.euals,gnore(ase=06mploee0>> ?

    88create a ne+ instance of emploee

    temp6mp / ne+ 6mploee=>

    temp6mp.setTpe=attributes.getHalue=0tpe0>>

    B

    B

    public )oid c!aracters=c!arN c!' int start' int lengt!> t!ro+s SAX6"ception

    ?

    tempHal / ne+ String=c!'start'lengt!> B

    public )oid end6lement=String uri' String local7ame' String 7ame> t!ro+s SAX6"ception

    ?

    if=7ame.euals,gnore(ase=06mploee0>> ?

    88add it to t!e list m6mpls.add=temp6mp> B

    else if =7ame.euals,gnore(ase=07ame0>>

    ? temp6mp.set7ame=tempHal> B

    else if =7ame.euals,gnore(ase=0,d0>> ?

    temp6mp.set,d=,nteger.parse,nt=tempHal>>

    B

    B

  • 7/26/2019 ip lab (2)

    7/65

    )& I'"#a'ing an( p#in'ing.

    pri)ate )oid printData=>?

    Sstem.out.println=07o of 6mploees J0 F m6mpls.siKe=> F 0J.0>

    ,terator it / m6mpls.iterator=>

    +!ile=it.!as7e"t=>> ?

    Sstem.out.println=it.ne"t=>.toString=>>

    B

    B

  • 7/26/2019 ip lab (2)

    8/65

    OUTPUT:

    6mploee Details 3 7ame:Seagull' Tpe:permanent' ,d:%9*' Age:%*.

    6mploee Details 3 7ame:;obin' Tpe:contract' ,d:%9

  • 7/26/2019 ip lab (2)

    9/65

    EX.NO.

    SER/ER SIDE APPLICATION USING 0SP

    STUDENT IN1ORMATION S2TEM USING 0SP AND SER/LET

    AIM:

    To de)elop t!e student +ebpage information using #a)a ser)let and ID@(.

    ALGORITHM:

    Step 1: Start t!e program

    Step $:(reate main TML page for student database maintenance

    Step %: Select option to do t!e follo+ing operation ,nsertion' searc! 'delete and modif or update t!e student recode

    Main.H'm

    -!tml5

    -bod bgcolor/ello+ te"t/red5

    -di) align/center5

    -label5-!$5Student database maintenance-8!$5 -8label5

    -TA@L65

    -T;5-TD5-a !ref/0!ttp:88local!ost:18student8register.!tml05;6G,ST6;-8a5-8TD5-8T ;5

    -T;5-TD5-a !ref/0!ttp:88local!ost:18student8find%05S6A;(-8a5-8TD5-8T;5

    -T;5-TD5-a !ref/0!ttp:88local!ost:18student8)ie+all05H,6 ALL -8a5-8TD5-8T;5

    -T;5-TD5-a !ref/0!ttp:88local!ost:18student8delete$.!tml05D6L6T6-8a5-8TD5-8T;5

    -33-T;5-TD5-a !ref/0!ttp:88local!ost:18student8update052PDAT6-8a5-8TD5-8T;5335

    -8table5

    -8di)5

    -8bod5

    R"gis'"#.HTML

    -DO(TQP6 TML P2@L,( 0388%(88DTD TML *. Transitional886705

    -TML5

    -6AD5

  • 7/26/2019 ip lab (2)

    10/65

    -T,TL65 registration -8T,TL65

    -86AD5

    -@ODQ bgcolor/teaC te"t/red5

    -form action/0!ttp:88local!ost:18student8register10 met!od/post5

    -pre5

    6nter ,d : -input tpe/te"t name/0id0 siKe/* 5-br5

    6nter 7ame : -input tpe/te"t name/0name0 siKe/$ 5-br5

    6nter Age : -input tpe/te"t name/0age0 siKe/* 5-br5

    6nter @ranc!: -input tpe/te"t name/0branc!0 siKe/1 5-br5

    6nter MarC1 : -input tpe/te"t name/0m10 siKe/* 5-br5

    6nter MarC$ : -input tpe/te"t name/0m$0 siKe/* 5-br5

    6nter MarC% : -input tpe/te"t name/0m%0 siKe/* 5-br5

    6nter Grade : -input tpe/te"t name/0grade0 siKe/$ 5-br5

    (licC : -input tpe/0submit0 name/0submit0 )alue/register5

    -8pre5-8form5-8@ODQ5-8TML5

    Ins"#'.H'm

    -DO(TQP6 TML P2@L,( 0388%(88DTD TML *. Transitional886705

    -TML5

    -6AD5

    -T,TL65 registration -8T,TL65

    -86AD5

    -@ODQ bgcolor/teaC te"t/red5

    -form action/0!ttp:88local!ost:18student8insert0 met!od/post5

    -pre5

    -di) align/center5

    6nter ,d : -input tpe/te"t name/0id0 siKe/* 5-br5

    6nter 7ame : -input tpe/te"t name/0name0 siKe/$ 5-br5

    6nter Age : -input tpe/te"t name/0age0 siKe/* 5-br5

  • 7/26/2019 ip lab (2)

    11/65

    6nter @ranc!: -input tpe/te"t name/0branc!0 siKe/1 5-br5

    6nter MarC1 : -input tpe/te"t name/0m10 siKe/* 5-br5

    6nter MarC$ : -input tpe/te"t name/0m$0 siKe/* 5-br5

    6nter MarC% : -input tpe/te"t name/0m%0 siKe/* 5-br5

    6nter Grade : -input tpe/te"t name/0grade0 siKe/* 5-br5

    -input tpe/0submit0 name/0submit0 )alue/register5

    -8di)5-8pre5-8form5-8@ODQ5-8TML5

    D""'".H'm

    -DO(TQP6 TML P2@L,( 0388%(88DTD TML *. Transitional886705

    -TML5

    -6AD5

    -T,TL65 D6L6T6 ST2D67T ;6(O;D -8T,TL65

    -86AD5

    -@ODQ bgcolor/ello+ te"t/can5

    -form action/0!ttp:88local!ost:18student8delete$0 met!od/post5

    -pre5

    6nter t!e ,D :-input tpe/te"t name/0idno0 siKe/* 5-br5

    (licC :-input tpe/0submit0 name/submit )alue/delete5

    -8pre5 -8form5 -8@ODQ5 -8TML5

    S")on(.$a%a

    import #a)a.io.

    import #a)a".ser)let.

    import #a)a".ser)let.!ttp.

    import #a)a.sl.

    import #a)a.lang.

    public class second e"tends ttpSer)let

    ?

    public )oid doGet=ttpSer)let;euest re'ttpSer)let;esponse res>t!ro+s Ser)let6"ception',O6"ception

  • 7/26/2019 ip lab (2)

    12/65

    ?

    loginform=res'false>

    B88goGet=>

    pri)ate )oid loginform=ttpSer)let;esponse res'boolean error>t!ro+s

    Ser)let6"ception',O6"ception ?

    res.set(ontentTpe=0te"t8!tml0>

    Printriter pr/res.getriter=>

    pr.println=0-!tml5-bod bgcolor/blue te"t/red50>

    pr.println=0-di) align/center50>

    if=error>

    ?

    pr.println=0-$5LOG,7 &A,L6D' PL6AS6 T;Q AGA,7-8$50>

    B

    pr.println=0-form met!od/post 7AM6/&O;M50>

    pr.println=0-table5-T;5-TD5-label5 please enter our name and pass+ord-8label5-8T;5-8TD50>

    pr.println=0-T;5-TD52sername:-input tpe/te"t name/username5 0>

    pr.println=0-T;5-TD5Pass+ord:-input tpe/pass+ord name/pass+ord5-br5-8T;5-8TD5-!r

    +idt!/1R5-8T;5-8TD50>

    pr.println=0-T;5-TD5Press:-input tpe/submit name/submit )alue/(ontinue5-8T;5-8TD50>

    pr.println=0-T;5-TD5clear:-input tpe/reset name /reset )alue/(lear5-8T;5-8TD5-8TA@L650>

    pr.println=0-8form5-8di)5-8bod5-8!tml50> B

    88loginform=>

    public )oid doPost=ttpSer)let;euest re'ttpSer)let;esponse res>t!ro+s Ser)let6"ception',O6"ception ?

    String name/re.getParameter=0username0>

    String pass/re.getParameter=0pass+ord0>

    if=logindb=name'pass>> ?

    ;euestDispatc!er rd/re.get;euestDispatc!er=08main.!tml0>

    rd.for+ard=re'res>

  • 7/26/2019 ip lab (2)

    13/65

    B else ?

    loginform=res'true> B B

    88doPost=>

    boolean logindb=String name' String pass> ?

    tr ?

    (lass.for7ame=0sun.#dbc.odbc.IdbcOdbcDri)er0>

    (onnection con/Dri)erManager.get(onnection=0#dbc:odbc:logindb0>

    Statement s/con.createStatement=>

    String sl/0select from stu +!ere username/ J0 F name F 0J A7D pass+ord/ J0 F pass F 0J 0

    ;esultSet rs/s.e"ecuteuer=sl>

    if=rs.ne"t=>> ? return true B

    con.close=> B

    catc!=SL6"ception s> ?

    s.printStacCTrace=>

    B catc!=6"ception e> ?

    e.printStacCTrace=> B

    return false

    B

    88login=>

    B

    R"gis'"#3.$a%a

    8 ,7S6;T,7G T6 DATA 8

    import #a)a".ser)let.

    import #a)a".ser)let.!ttp.

    import #a)a.io.

    import #a)a.util.

    import #a)a.sl.

    import #a)a.lang.

  • 7/26/2019 ip lab (2)

    14/65

    public class register1 e"tends ttpSer)let ?

    public )oid doPost=ttpSer)let;euest re'ttpSer)let;esponse res>t!ro+s Ser)let6"ception' ,O6"ception ?

    tr ?

    res.set(ontentTpe=0Te"t8!tml0>

    Printriter pr/res.getriter=>

    int id/,nteger.parse,nt=re.getParameter=0id0>>

    String name/re.getParameter=0name0>

    int age/,nteger.parse,nt=re.getParameter=0age0>>

    String branc!/re.getParameter=0branc!0>

    int m1/,nteger.parse,nt=re.getParameter=0m10>>

    int m$/,nteger.parse,nt=re.getParameter=0m$0>>

    int m%/,nteger.parse,nt=re.getParameter=0m%0>>

    String grade/re.getParameter=0grade0>

    pr.println=0-!tml5-bod bgcolor/ello+ te"t/red5-di) align/center50>

    (lass.for7ame=0sun.#dbc.odbc.IdbcOdbcDri)er0>

    (onnection con/Dri)erManager.get(onnection=0#dbc:odbc:ss0>

    88pr.println=0student information are successfull registered0>

    88pr.println=0-a !ref/!ttp:88local!ost:18student8main.!tml5goto main page-8a50>

    PreparedStatement pst/con.prepareStatement=0,nsert into studata )alues='''''''> 0>

    pst.set,nt=1'id>

    pst.setString=$'name>

    pst.set,nt=%'age>

    pst.setString=*'branc!>

    pst.set,nt=

    pst.set,nt='m%>

    pst.setString=4'grade>

    pst.e"ecuteuer=>

  • 7/26/2019 ip lab (2)

    15/65

    pr.println=0student information are successfull registered0>

    pr.println=0-a !ref/!ttp:88local!ost:18student8main.!tml5goto main page-8a50>

    pr.println=0-8!tml5-8bod50>

    con.commit=>

    B

    catc!=SL6"ception e> ?

    Sstem.out.println=e.getMessage=>>

    B catc!=6"ception e> ? e.printStacCTrace=>

    B

    B

    B

    Ins"#'.$a%a

    import #a)a".ser)let.

    import #a)a".ser)let.!ttp.

    import #a)a.io.

    import #a)a.util.

    import #a)a.sl.

    import #a)a.lang.

    public class register e"tends ttpSer)let

    ?

    public )oid doPost=ttpSer)let;euest re'ttpSer)let;esponse res>t!ro+s Ser)let6"ception' ,O6"ception

    ?

    tr ?

    res.set(ontentTpe=0Te"t8!tml0>

    Printriter pr/res.getriter=>

    int id/,nteger.parse,nt=re.getParameter=0id0>>

    String name/re.getParameter=0name0>

    int age/,nteger.parse,nt=re.getParameter=0age0>>

  • 7/26/2019 ip lab (2)

    16/65

    String branc!/re.getParameter=0branc!0>

    int m1/,nteger.parse,nt=re.getParameter=0m10>>

    int m$/,nteger.parse,nt=re.getParameter=0m$0>>

    int m%/,nteger.parse,nt=re.getParameter=0m%0>>

    String grade/re.getParameter=0grade0>

    pr.println=0-!tml5-bod bgcolor/ello+ te"t/red5-di) align/center50>

    (lass.for7ame=0sun.#dbc.odbc.IdbcOdbcDri)er0>

    (onnection con/Dri)erManager.get(onnection=0#dbc:odbc:ss0>

    88 pr.println=0Get connection0>

    PreparedStatement pst/con.prepareStatement=0,nsert into studata )alues='''''''> 0>

    pst.set,nt=1'id>

    pst.setString=$'name>

    pst.set,nt=%'age>

    pst.setString=*'branc!>

    pst.set,nt=

    pst.set,nt='m%>

    pst.setString=4'grade>

    pst.e"ecuteuer=>

    con.commit=>

    pr.println=0student information are successfull registered0>

    pr.println=0-a !ref/!ttp:88local!ost:18student8main.!tml5goto main page-8a50>

    pr.println=0-8!tml5-8bod50>

    con.close=> B

    catc!=SL6"ception e>

    ?

    Sstem.out.println=e.getMessage=>> B

    catc!=6"ception e> ?

  • 7/26/2019 ip lab (2)

    17/65

    e.printStacCTrace=>

    B

    B

    B

    1in(4.0a%a

    8 S6A;( T6 PA;T,(2LA; ;6(O;D 8

    import #a)a".ser)let.

    import #a)a".ser)let.!ttp.

    import #a)a.io.

    import #a)a.util.

    import #a)a.sl.

    import #a)a.lang.

    public class find% e"tends ttpSer)let ?

    public )oid doGet=ttpSer)let;euest re'ttpSer)let;esponse res>t!ro+s Ser)let6"ception' ,O6"ception ?

    res.set(ontentTpe=0Te"t8!tml0>

    Printriter pr/res.getriter=>

    pr.println=0-!tml5-bod bgcolor/blacC te"t/green5-di) align/center50>

    pr.println=0-form action/!ttp:88local!ost:18student8find% met!od/post name/form150>

    pr.println=0-!*56nter t!e student ,D:-8!*5-input tpe/te"t name/id 50>

    pr.println=0-!*5clicC:-8!*5-input tpe/submit name/submit )alue/searc!50>

    pr.println=0-8form5-8di)5-8bod5-8!tml50> B

    public )oid doPost=ttpSer)let;euest re'ttpSer)let;esponse res>t!ro+s Ser)let6"ception' ,O6"ception ?

    tr ?

    res.set(ontentTpe=0Te"t8!tml0>

    Printriter pr/res.getriter=>

    String id /re.getParameter=0id0>

    int idno/,nteger.parse,nt=id>

    pr.println=0-!tml5-bod bgcolor/blacC te"t/green5-di) align/center50>

  • 7/26/2019 ip lab (2)

    18/65

    (lass.for7ame=0sun.#dbc.odbc.IdbcOdbcDri)er0>

    (onnection con/Dri)erManager.get(onnection=0#dbc:odbc:ss0>

    88PreparedStatement pst/con.prepareStatement=0select from studata +!ere ,D/ J0 F idno F 0J 0>

    PreparedStatement pst/con.prepareStatement=0select from studata +!ere ,D/ 0>

    pst.set,nt=1'idno>

    ;esultSet r/pst.e"ecuteuer=>

    +!ile=r.ne"t=>> ?

    pr.println=r.get,nt=1>F0t0Fr.getString=$>F0t0Fr.get,nt=%>F0t0Fr.getSt

    ring=*>F0t0Fr.get,nt=F0t0Fr.get,nt=9>F0t0Fr.get,nt=>F0t0Fr.getString=4> >

    pr.println=0-br50>

    B

    pr.println=0-a !ref/!ttp:88local!ost:18student8main.!tml5goto main page-8a50> pr.println=0-8!tml5-8bod50>

    B catc!=SL6"ception e> ?

    Sstem.out.println=e.getMessage=>> B

    catc!=6"ception e> ?

    e.printStacCTrace=>

    B B B

    D""'".$a%a

    import #a)a".ser)let.

    import #a)a".ser)let.!ttp.

    import #a)a.io.

    import #a)a.util.

    import #a)a.sl.

    import #a)a.lang.

    public class delete$ e"tends ttpSer)let ?

    public )oid doPost=ttpSer)let;euest re'ttpSer)let;esponse res>t!ro+s Ser)let6"ception' ,O6"ception ?

    tr ?

    res.set(ontentTpe=0Te"t8!tml0>

  • 7/26/2019 ip lab (2)

    19/65

    Printriter pr/res.getriter=>

    pr.println=0-!tml5-bod bgcolor/blacC te"t/ello+50>

    String idno/re.getParameter=0idno0>

    int id/,nteger.parse,nt=idno>

    (lass.for7ame=0sun.#dbc.odbc.IdbcOdbcDri)er0>

    (onnection con/Dri)erManager.get(onnection=0#dbc:odbc:ss0>

    pr.println=0get connected0>

    88PreparedStatement pst/con.prepareStatement=0Delete from studata +!ere ,D/ J0 F id F 0J 0>

    PreparedStatement pst/con.prepareStatement=0Delete from studata +!ere ,D/ 0>

    pst.set,nt=1'id>

    pst.e"ecute2pdate=>

    pr.println=0-!$5student record is successfull deleted0>

    pr.println=0-a !ref/!ttp:88local!ost:18student8main.!tml5goto main page-8a50> pr.println=0-8!tml5-8bod50>

    con.commit=> B

    catc!=SL6"ception e> ?

    Sstem.out.println=e.getMessage=>> B

    catc!=6"ception e> ?

    e.printStacCTrace=>

    B

    B

    B

  • 7/26/2019 ip lab (2)

    20/65

    OUTPUT:

    S'*("n' 'a+":

  • 7/26/2019 ip lab (2)

    21/65

  • 7/26/2019 ip lab (2)

    22/65

  • 7/26/2019 ip lab (2)

    23/65

    RESULT :

    T!us student information #a)a script program is successfull completed

  • 7/26/2019 ip lab (2)

    24/65

    EX NO:67.

    8EB CUSTOMISATION

    CREATION O1 8EB APPLICATION USING PHP

    AIM:

    To create a calculator +eb appliction using p!p.

    ALGORITHM :

    Step1 : Start t!e program

    Step$ : (reate a p!p +eb page calc.p!p

    Step%: 2sing form and input tpe tag create )arious buttons' te"tbo"' radio button etc.

    Step*: calcute t!e output for )arious option

    Step

  • 7/26/2019 ip lab (2)

    25/65

    -form action/0-p!p ec!o VWS6;H6;NJPPWS6L&J50 met!od/0post05

    -tr5

    -td57umber:-8td5

    -td5-input tpe/0te"t0 ma"lengt!/0%0 name/0number0 siKe/0*0 85

    -8td5

    -8tr5

    -span id/0suare05

    -tr5

    -td5Anot!er number:-8td5

    -td5-input tpe/0te"t0 ma"lengt!/0*0 name/0number$0 siKe/0*0 85

    -8td5

    -8tr5

    -8span5

    -tr5

    -td )align/0top05Operator:-8td5

    -td5

    -input tpe/0radio0 name/0opt0 )alue/0F0 -85F-br 85

    -input tpe/0radio0 name/0opt0 )alue/030 853-br 85

    -input tpe/0radio0 name/0opt0 )alue/00 85-br 85

    -input tpe/0radio0 name/0opt0 )alue/080 858-br 85

    -input tpe/0radio0 name/0opt0 )alue/0$0 85"-sup5$-8sup5-br 85

    -input tpe/0radio0 name/0opt0 )alue/0srt0 85srt-br 85

    -input tpe/0radio0 name/0opt0 )alue/00 85-br 85

    -8td5

    -8tr5

    -tr5

    -td5;ounding:-8td5

    -td5

  • 7/26/2019 ip lab (2)

    26/65

    -input tpe/0te"t0 name/0rounding0 )alue/0*0 siKe/0*0 ma"lengt!/0*0 85-8td5

    -td5

    -small5=6nter !o+ man digits ou +ould liCe to round to>-8small5

    -8td5

    -8tr5

    -tr5

    -td5

    -input tpe/0submit0 )alue/0(alculate0 name/0submit0 85

    -8td5

    -8tr5

    -8form5

    -8table5

    -p!p

    B

    if =empt=VWPOSTNJsubmitJ>> ?

    s!o+&orm=>

    B else ?

    Verrors / arra=>

    Verror / false

    if =isWnumeric=VWPOSTNJnumberJ>> ?

    =int>VWPOSTNJnumberJ / rand=1'$>

    B

    if =empt=VWPOSTNJnumberJ>> ?

    =int>VWPOSTNJnumberJ / rand=1'$>

    B

    if =isWnumeric=VWPOSTNJnumber$J>> ?

    =int>VWPOSTNJnumber$J / rand=1'$>

    B

  • 7/26/2019 ip lab (2)

    27/65

    if =empt=VWPOSTNJnumber$J>> ?

    =int>VWPOSTNJnumber$J / rand=1'$>

    B

    if =empt=VWPOSTNJroundingJ>> ?

    Vround /

    B

    if =isset=VWPOSTNJoptJ>> ?

    VerrorsN / 0Qou must select an operation.0

    Verror / true

    B

    if =strpbrC=VWPOSTNJnumberJ'030> and strpbrC=VWPOSTNJnumber$J'0.0> and VWPOSTNJoptJ // 00> ?

    VerrorsN / 0Qou cannot raise a negati)e number to a decimal' t!is is impossible.

    -a !ref/0!ttp:88!udKilla.org8p!p+iCi8inde".p!ptitle/Ot!erWmat!ematicalWcon) ersionWfunctions05!-8a50

    Verror / true

    B

    if =Verror / false> ?

    ec!o 0e found t!ese errors:0

    ec!o 0-ul50

    foreac! =Verrors as Ve> ?

    ec!o 0-li5Ve-8li50

    B

    ec!o 0-8ul50

    B else ?

    s+itc! =VWPOSTNJoptJ> ? case 0F0: Vresult / =int>stripWtags=VWPOSTNJnumberJ> F=int>stripWtags=VWPOSTNJnumber$J>

    ec!o 0T!e ans+er to 0 . =int>stripWtags=VWPOSTNJnumberJ> . 0 VWPOSTNopt 0 . =int>stripWtags=VWPOSTNJnumber$J> .

    0 is Vresult.0

    breaC

    case 030

  • 7/26/2019 ip lab (2)

    28/65

    Vresult / =int>stripWtags=VWPOSTNJnumberJ> 3 =int>stripWtags=VWPOSTNJnumber$J>

    ec!o 0T!e ans+er to 0 . =int>stripWtags=VWPOSTNJnumberJ> . 0 VWPOSTNopt 0 . =int>stripWtags=VWPOSTNJnumber$J> .

    0 is Vresult.0

    breaC

    case 00

    Vresult / =int>stripWtags=VWPOSTNJnumberJ> =int>stripWtags=VWPOSTNJnumber$J> ec!o 0T!e ans+er to 0 .

    =int>stripWtags=VWPOSTNJnumberJ> . 0 VWPOSTNopt 0 . =int>VWPOSTNJnumber$J . 0 is Vresult.0

    breaC

    case 080

    Vresult / =int>stripWtags=VWPOSTNJnumberJ> 8 =int>stripWtags=VWPOSTNJnumber$J> Va / ceil=Vresult>

    ec!o 0-br 850

    ec!o 0-!r 850

    ec!o 0-!$5;ounding-8!$50

    ec!o 0Vresult rounded up is Va0

    ec!o 0-br 850

    Vb / floor=Vresult>

    ec!o 0Vresult rounded do+n is Vb0

    ec!o 0-br 850

    V! / round=Vresult'=int>VWPOSTNJroundingJ> ec!o 0Vresult rounded to VWPOSTNrounding digits is 0 . V!

    breaC

    case 0$0:

    Vresult / =int>stripWtags=VWPOSTNJnumberJ> =int>stripWtags=VWPOSTNJnumber$J> Va / =int>VWPOSTNJnumber$J

    =int>VWPOSTNJnumber$J

    ec!o 0T!e ans+er to 0 . =int>VWPOSTNJnumberJ . 0-sup5$-8sup5 is 0 . Vresult

    ec!o 0-br 850

    ec!o 0T!e ans+er to 0 . =int>VWPOSTNJnumber$J . 0-sup5$-8sup5 is 0 . Va

    breaC

    case 0srt0:

  • 7/26/2019 ip lab (2)

    29/65

    Vresult / =int>stripWtags=srt=VWPOSTNJnumberJ>>

    Vsrt$ / =int>stripWtags=srt=VWPOSTNJnumber$J>>

    ec!o 0T!e suare root of 0 . =int>stripWtags=VWPOSTNJnumberJ> . 0 is 0 . Vresult ec!o 0-br 850

    ec!o 0T!e suare root of 0 . =int>stripWtags=VWPOSTNJnumber$J> . 0 is 0 . Vsrt$ ec!o 0-br 850

    ec!o 0T!e suare root of 0 . =int>stripWtags=VWPOSTNJnumberJ> . 0 rounded to 0 . stripWtags=VWPOSTNrounding> . 0

    digits is 0 . round=Vresult'=int>VWPOSTNJroundingJ>

    ec!o 0-br 850

    ec!o 0T!e suare root of 0 . =int>stripWtags=VWPOSTNJnumber$J> . 0 rounded to 0 . stripWtags=VWPOSTNrounding> . 0

    digits is 0 . round=Vsrt$'=int>stripWtags=VWPOSTNJroundingJ>>

    breaC

    case 00:

    Vresult / =int>stripWtags=po+=VWPOSTNJnumberJ'VWPOSTNJnumber$J>>

    Vpo+$ / =int>stripWtags=po+=VWPOSTNJnumber$J'VWPOSTNJnumberJ>>

    ec!o =int>VWPOSTNJnumberJ . 0-sup50 . stripWtags=VWPOSTNnumber$> . 0-8sup5 is 0 . Vresult

    ec!o 0-br 850 ec!o =int>VWPOSTNJnumber$J . 0-sup50 . stripWtags=VWPOSTNnumber> . 0-8sup5 is 0 . Vpo+$

    breaC

    B

    B

    B

    ec!o 0-br 850

    5

    -a !ref/0calc.p!p05Go @acC-8a5

    -8bod5

    -8!tml5

  • 7/26/2019 ip lab (2)

    30/65

    OUTPUT:

  • 7/26/2019 ip lab (2)

    31/65

  • 7/26/2019 ip lab (2)

    32/65

    RESULT:

    T!us t!e calculator +eb appliction using p!p is been de)eloped succesfull.

  • 7/26/2019 ip lab (2)

    33/65

    EX NO. 9

    DE/ELOPMENT O1 EBUSINESS APPLICATION.

    AIM:

    To create a calculator +eb appliction using p!p.

    ALGORITHM :

    Step1: Start t!e program

    Step$: (reate a p!p +eb page contact.p!p

    Step%: 2sing form and input tpe tag create )arious buttons' te"tbo"' radio button etc.

    Step*: Get t!e necessar field from t!e user.

    Step

  • 7/26/2019 ip lab (2)

    34/65

    Vemail / VWPOSTNJemailJ

    Vmessage / VWPOSTNJmessageJ

    Verror/

    if =isset=VWPOSTNJsubmitJ>> ?

    if =eregi=J!ttp:J' Vnotes>> ?

    die =0Do 7OT tr t!at 0>

    B

    if=Vemail // 00 EE =strstr=Vemail'0Z0> [[ strstr=Vemail'0.0>>>

    ?

    ec!o 0-!$52se @acC 3 6nter )alid e3mail-8!$5n0

    Vbadinput / 0-!$5&eedbacC +as 7OT submitted-8!$5n0

    ec!o Vbadinput

    Verror/1

    B

    if=empt=Vname> [[ empt=Vp!onenumber> [[ empt=Vemail > [[ empt=Vmessage>>

    ?

    ec!o 0-!$52se @acC 3 fill in all reuired fields -8!$5n0

    Verror/1

    B

    if=Verror/1> ?

    Vtodais / date=0l' & #' Q' g:i a0>

    Vattn / Vsub#ect

    Vsub#ect / 0mail from Vemail0

    Vmessage / stripcslas!es=Vmessage>

    Vmailmessage / 0 Vtodais N6ST n Sub#ect: Vsub#ect n Message: Vmessage n &rom: Vname =Vemail>n (it:

    Vcitn Pin8\ip code: VKipn P!one7o: Vp!onenumbern 0

    Vfrom /0&rom: Vemail rn0

    mail=0UUabinZgmail.com0 'Vsub#ect' Vmailmessage'Vfrom>

  • 7/26/2019 ip lab (2)

    35/65

    ec!o 0T!anC Qou :0

    ec!o 0Vname=0 ec!o 0Vemail >0

    ec!o 0for our interest in our ser)ices. e +ill contact ou soon -br50

    B

    else ?

    ec!o 02se @acC and &ill all reuired fields 0

    B

    B

    else

    ?

    5

    -form action/0-p!p ec!o VWS6;H6;NJPPWS6L&J 50 met!od/0post0 enctpe/0multipart8form3data0

    id/0form105 -table cellspacing/00 cellpadding/0$0 +idt!/01R0 border/00 class/0te"tWmain05

    -tr5

    -td align/0rig!t0 )align/0center05

    -strong5 -font color/0Yff05-8font5Enbsp7ame : -8strong5

    -8td5

    -td align/0left0 )align/0center05

    -input stle/0,DT: $p" 6,GT: $$p"0 siKe/0$90 name/0name0 85

    -8td5

    -8tr5

    -tr5

    -td align/0rig!t0 )align/0center05

    -strong5Address :-8strong5

    -8td5

    -td align/0left0 )align/0center05

    -te"tarea stle/0,DT: $

  • 7/26/2019 ip lab (2)

    36/65

    -8td5

    -8tr5

    -tr5

    -td align/0rig!t0 )align/0center05

    -strong5 (it : -8strong5 -8td5

    -td align/0left0 )align/0center05

    -input stle/0,DT: $

  • 7/26/2019 ip lab (2)

    37/65

    -td )align/0center0 align/0left05

    -input tpe/0submit0 )alue/0Send0 name/0submit0 85 EnbspEnbspEnbspEnbspEnbsp

    -input tpe/0reset0 )alue/0(lear0 name/0reset0 85

    -8td5 -8tr5

    -tr5

    -td )align/0center0 align/0rig!t05 -8td5

    -td )align/0center0 align/0left0 !eig!t/01

  • 7/26/2019 ip lab (2)

    38/65

    OUTPUT:

    RESULT:

    T!us t!e P!p application !as been de)eloped and e"ecuted successfull.

  • 7/26/2019 ip lab (2)

    39/65

    A+o*'Us.p-p

    -p!p

    sessionWstart=>

    5

    -DO(TQP6 !tml P2@L,( 0388%(88DTD XTML 1. Transitional88670

    0!ttp:88+++.+%.org8T;8"!tml18DTD8"!tml13transitional.dtd05

    -!tml "mlns/0!ttp:88+++.+%.org81UUU8"!tml05

    -!ead5

    -meta !ttp3eui)/0(ontent3Tpe0 content/0te"t8!tml c!arset/iso344

  • 7/26/2019 ip lab (2)

    40/65

    P!one : *$1 *$

  • 7/26/2019 ip lab (2)

    41/65

    -!ead5

    -meta !ttp3eui)/0(ontent3Tpe0 content/0te"t8!tml c!arset/iso344

  • 7/26/2019 ip lab (2)

    42/65

    Vuer / 0S6L6(T id' title' price &;OM booCs 6;6 id / 0.Vselected@ooCsNVi

    Vresult / mslWuer=Vuer>

    if=Vro+ / mslWfetc!Wassoc=Vresult>>

    ?

    Vtitle / Vro+NJtitleJ

    Vprice / Vro+NJpriceJ

    Vtotal F/ Vprice

    5

    -tr5

    -td align/0left0 )align/0top05-p!p ec!o Vsno 5-8td5

    -td align/0left0 )align/0top05-p!p ec!o Vtitle 5-8td5

    -td align/0rig!t0 )align/0top05-p!p ec!o Vprice 5-8td5

    -8tr5

    -p!p

    B

    VsnoFF

    B

    5

    -tr5

    -td colspan/0$0 align/0rig!t0 )align/0top05Total Amount =;s> -8td5

    -td align/0rig!t0 )align/0top05

    -p!p ec!o numberWformat=Vtotal'$'J.J'J'J>

    5

    -8td5

    -8tr5

    -8table5

    -8di)5

    -di) id/0footer05 -8di)5

  • 7/26/2019 ip lab (2)

    43/65

    -8di)5

    -8bod5

    -8!tml5

    DEPARTMENT.PHP

    -p!p

    sessionWstart=>

    include =JDb.p!pJ>

    if=isset=VWS6SS,O7NJsesWusernameJ>>

    ?

    !eader=0Location:Login.p!p0>

    B

    if=isset=VWPOSTNJseldeptJ>>

    ?

    !eader=0Location: @ooCList.p!pfDepartment/0.VWPOSTNJfDepartmentJ>

    B

    5

    -DO(TQP6 !tml P2@L,( 0388%(88DTD XTML 1. Transitional88670

    0!ttp:88+++.+%.org8T;8"!tml18DTD8"!tml13transitional.dtd05

    -!tml "mlns/0!ttp:88+++.+%.org81UUU8"!tml05

    -!ead5

    -meta !ttp3eui)/0(ontent3Tpe0 content/0te"t8!tml c!arset/iso344

  • 7/26/2019 ip lab (2)

    44/65

    includeWonce Jeader.p!pJ

    5

    -33 !eader ends 335

    -di) id/0content05

    -br 85

    -br 85

    -br 85

    -br 85

    -form action/0-p!p ec!o VWS6;H6;NJPPWS6L&J 50 met!od/0post0 name/0deptform05

    -table +idt!/0%%$0 border/00 align/0center0 cellpadding/0

  • 7/26/2019 ip lab (2)

    45/65

    -8label5-8td5

    -8tr5

    -8table5

    -8form5

    -br 85

    -br 85

    -br 85

    -br 85

    -br 85

    -span class/0font1*b05 -8span5

    -8di)5

    -di) id/0footer05

    -8di)5

    -8di)5

    -8bod5

    -8!tml5

    Boo;is'.P-p

    -p!p

    sessionWstart=>

    include =JDb.p!pJ>

    if=isset=VWS6SS,O7NJsesWusernameJ>>

    ?

    !eader=0Location:Login.p!p0>

    B

    if=isset=VWPOSTNJfPlaceOrderJ>>

    ?

    VWS6SS,O7NJorderdetailsJ / VWPOST !eader=0Location: Order.p!p0>

    B 5

  • 7/26/2019 ip lab (2)

    46/65

    -DO(TQP6 !tml P2@L,( 0388%(88DTD XTML 1. Transitional88670

    0!ttp:88+++.+%.org8T;8"!tml18DTD8"!tml13transitional.dtd05

    -!tml "mlns/0!ttp:88+++.+%.org81UUU8"!tml05

    -!ead5

    -meta !ttp3eui)/0(ontent3Tpe0 content/0te"t8!tml c!arset/iso344

  • 7/26/2019 ip lab (2)

    47/65

    -p!p

    Vdept / VWG6TNJfDepartmentJ

    Vuer / 0S6L6(T id' title' aut!orname' price' department &;OM booCs 6;6 department / 0.Vdept

    Vresult / mslWuer=Vuer' Vcon>

    Vi / 1

    +!ile=Vro+ / mslWfetc!Wassoc=Vresult>>

    ?

    5

    -tr5

    -td align/0center0 )align/0top05-p!p ec!o Vi 5-8td5

    -td align/0left0 )align/0top05-p!p ec!o Vro+NJtitleJ 5-8td5

    -td align/0left0 )align/0top05-p!p ec!o Vro+NJaut!ornameJ 5-8td5

    -td align/0left0 )align/0top05;s. -p!p ec!o Vro+NJpriceJ 5-8td5

    -td align/0center0 )align/0top05

    -input tpe/0c!ecCbo"0 name/0fSelect@ooCN0 )alue/0-p!p ec!o Vro+NJidJ 50 85

    -8td5

    -8tr5

    -p!p

    Vi / Vi F 1

    B

    5

    -8table5

    -br 85

    -br 85

    -di) stle/0te"t3align:center05

    -input tpe/0submit0 name/0fPlaceOrder0 )alue/0Place Order0 85

    -8di)5

    -8form5

  • 7/26/2019 ip lab (2)

    48/65

    -br 85

    -br 85

    -br 85

    -br 85

    -br 85

    -span class/0font1*b05

    -8span5

    -8di)5 -di) id/0footer05

    -8di)5

    -8di)5

    -8bod5

    -8!tml5

    D+.p-p

    -p!p

    VdbW!ostname / Jlocal!ostJ

    VdbWdbname / JebooCbiKJ

    VdbWusername / JrootJ

    VdbWpass+ord / JJ

    Vcon / mslWpconnect=VdbW!ostname' VdbWusername' VdbWpass+ord>

    mslWselectWdb=VdbWdbname' Vcon> 5

    H"a("#.p-p

    -di) id/0!eader05

    -di) id/0logo05

    -span class/0logoStle0563@OO]3@,\-8span5

    -8di)5

    -di) id/0na)igation05

    -a !ref/0inde".p!p0 class/0na)LinC05ome-8a5EnbspEnbspEnbspEnbsp[EnbspEnbspEnbspEnbsp

    -a !ref/0Login.p!p0 class/0na)LinC05Login-8a5EnbspEnbspEnbspEnbsp[EnbspEnbspEnbspEnbsp

  • 7/26/2019 ip lab (2)

    49/65

    -a !ref/0Department.p!p0 class/0na)LinC05Department-8a5EnbspEnbspEnbspEnbsp[

    EnbspEnbspEnbspEnbsp

    -a !ref/0&eedbacC.p!p0 class/0na)LinC05&eedbacC-8a5

    -8di)5

    -di) stle/0te"t3align:rig!t font3famil:JTrebuc!et MSJ font3siKe:1$p" font3+eig!t:bold05

    -p!p

    if=isset=VWS6SS,O7NJsesWusernameJ>>

    ?

    ec!o Jelcome J.VWS6SS,O7NJsesWusernameJ

    ec!o JEnbsp[Enbsp-a !ref/0Logout.p!p0 class/0na)LinC05Logout-8a5J

    B

    5

    -8di)5

    -8di)5

    In("x.p-p

    -

    p!p sessionWstart=>

    5

    -DO(TQP6 !tml P2@L,( 0388%(88DTD XTML 1. Transitional88670

    0!ttp:88+++.+%.org8T;8"!tml18DTD8"!tml13transitional.dtd05

    -!tml "mlns/0!ttp:88+++.+%.org81UUU8"!tml05

    -!ead5

    -meta !ttp3eui)/0(ontent3Tpe0 content/0te"t8!tml c!arset/iso344

  • 7/26/2019 ip lab (2)

    50/65

    -p!p includeWonce Jeader.p!pJ 5

    -33 !eader ends 335

    -di) id/0content05

    -br 85

    -br 85

    -br 85

    -span class/0font1*b05

    ,nformation Tec!nolog and (omputer Science @ooCs.

    -br 85

    -br 85

    -br 85

    Lo+ Price editions at discount to students of 2G and PG courses.

    -br 85

    -br 85

    -br 85

    ;egister toda to S!op for @ooCs

    -br 85

    -br 85

    -br 85

    -8span5

    -8di)5

    -di) id/0footer05

    -8di)5

    -8di)5

    -8bod5

    -8!tml5

    -p!p

    sessionWstart=>

  • 7/26/2019 ip lab (2)

    51/65

    include =JDb.p!pJ>

    if=isset=VWPOSTNJSubmitJ>>

    ?

    VloginWid / VWPOSTNJfLogin,dJ

    Vpass+ord / VWPOSTNJfPass+ordJ

    Vuer / 0S6L6(T username &;OM users 6;6 loginWid / J0.VloginWid.0J A7D pass+ord / J0.Vpass+ord.0J0

    Vresult / mslWuer=Vuer' Vcon>

    if=Vresult> ? +!ile=Vro+ / mslWfetc!Wassoc=Vresult>>

    ?

    Vuser7ame / Vro+NJusernameJ

    B

    VWS6SS,O7NJsesWusernameJ / Vuser7ame

    !eader=0Location: Department.p!p0>

    B

    else

    ?

    Vresultmsg / 0Please pro)ide correct login id and pass+ord0

    B

    B

    5

    -DO(TQP6 !tml P2@L,( 0388%(88DTD XTML 1. Transitional88670

    0!ttp:88+++.+%.org8T;8"!tml18DTD8"!tml13transitional.dtd05

    -!tml "mlns/0!ttp:88+++.+%.org81UUU8"!tml05

    -!ead5

    -meta !ttp3eui)/0(ontent3Tpe0 content/0te"t8!tml c!arset/iso344

  • 7/26/2019 ip lab (2)

    52/65

    -bod5

    -di) id/0+rapper05

    -33 !eader starts335

    -p!p

    includeWonce Jeader.p!pJ 5

    -33 !eader ends 335

    -di) id/0content05

    -br 85

    -br 85

    -br 85

    -br 85

    -di)5

    -p!p

    if=isset=Vresultmsg>>

    ?

    ec!o Vresultmsg

    B

    5

    -8di)5

    -form action/0-p!p ec!o VWS6;H6;NJPPWS6L&J 50 met!od/0post0 name/0loginform05

    -table +idt!/0%%$0 border/00 align/0center0 cellpadding/0

  • 7/26/2019 ip lab (2)

    53/65

    -input tpe/0te"t0 name/0fLogin,d0 85 -8label5-8td5

    -8tr5

    -tr5

    -td align/0rig!t0 )align/0top0 bgcolor/0Y6A6A6A05Pass+ord-8td5

    -td align/0left0 )align/0top0 bgcolor/0Y6A6A6A05-input tpe/0pass+ord0 name/0fPass+ord0 85

    -8td5

    -8tr5

    -tr5

    -td colspan/0$0 align/0center0 )align/0top0 bgcolor/0Y6(6(6(05

    -label5

    -input name/0Submit0 tpe/0submit0 )alue/0Login0 85

    -8label5

    -8td5

    -8tr5

    -tr5

    -td colspan/0$0 align/0left0 )align/0top0 bgcolor/0Y6(6(6(05

    -a !ref/0;egistration.p!p0 class/0na)LinC057e+ 2ser ;egister-8a5

    -8td5

    -8tr5

    -8table5

    -8form5

    -br 85

    -br 85

    -br 85

    -br 85

    -br 85

    -span class/0font1*b05

    -8span5

  • 7/26/2019 ip lab (2)

    54/65

    -8di)5

    -di) id/0footer05

    -8di)5

    -8di)5

    -8bod5

    -8!tml5

    Logo*'.p-p

    -p!p

    sessionWstart=>

    sessionWdestro=>

    !eader=0Location:inde".p!p0>

    5

    R"gis'#a'ion.p-p

    -p!p

    sessionWstart=>

    include =JDb.p!pJ>

    if=empt=VW;626STNJSubmitJ>>

    ?

    88ec!o Jform submitted for registration...J

    Vname / VWPOSTNJf7ameJ

    Vaddress1 / VWPOSTNJfAddress1J

    Vaddress$ / VWPOSTNJfAddress$J

    Vcit / VWPOSTNJf(itJ

    Vstate / VWPOSTNJfStateJ

    Vpincode / VWPOSTNJfPincodeJ

    Vp!one / VWPOSTNJfP!oneJ

    Vemail / VWPOSTNJf6mailJ

    VloginWid / VWPOSTNJfLogin,dJ

  • 7/26/2019 ip lab (2)

    55/65

    Vpass+ord / VWPOSTNJfPass+ordJ

    Vuer / 0,7S6;T ,7TO users = id' username' address1' address$' cit' state' pincode' p!one' email'loginWid'

    pass+ord > HAL26S = null' J?VnameBJ' J?Vaddress1BJ' J?Vaddress$BJ'

    J?VcitBJ'J?VstateBJ'J?VpincodeBJ'J?Vp!oneBJ'J?VemailBJ' J?VloginWidBJ'J?Vpass+ordBJ >0

    mslWuer=Vuer' Vcon>

    Vmsg / J;egistration successful.J

    !eader=0Location: Login.p!pmsg/success0>

    B

    5

    -DO(TQP6 !tml P2@L,( 0388%(88DTD XTML 1. Transitional88670

    0!ttp:88+++.+%.org8T;8"!tml18DTD8"!tml13transitional.dtd05

    -!tml "mlns/0!ttp:88+++.+%.org81UUU8"!tml05

    -!ead5

    -meta !ttp3eui)/0(ontent3Tpe0 content/0te"t8!tml c!arset/iso344

  • 7/26/2019 ip lab (2)

    56/65

    return false

    B

    if=frm.fLogin,d.)alue // JJ>

    ?

    alert=0Please enter our Login ,d0>

    return false

    B

    if=frm.fPass+ord.)alue // JJ>

    ?

    alert=0Please enter our Pass+ord0>

    return false

    B

    B

    -8script5

    -8!ead5

    -bod5

    -di) id/0+rapper05

    -33 !eader starts335

    -p!p

    includeWonce Jeader.p!pJ

    5

    -33 !eader ends 335

    -di) id/0content05

    -br 85

    -br 85

    -br 85

    -br 85

    -di)5

  • 7/26/2019 ip lab (2)

    57/65

    -p!p

    if=isset=Vmsg>>

    ?

    88ec!o Vmsg

    B

    5

    -8di)5

    -form action/0-p!p ec!o VWS6;H6;NJPPWS6L&J 50 met!od/0post0 name/0regform0 onsubmit/0return

    )alidate=>05

    -table +idt!/0%%$0 border/00 align/0center0 cellpadding/0

  • 7/26/2019 ip lab (2)

    58/65

    -td +idt!/01940 align/0left0 )align/0top0 bgcolor/0Y6A6A6A05

    -input name/0fAddress$0 tpe/0te"t0 id/0fAddress$0 85

    -8td5

    -8tr5

    -tr5

    -td +idt!/01**0 align/0rig!t0 )align/0top0 bgcolor/0Y6A6A6A05(it-8td5

    -td +idt!/01940 align/0left0 )align/0top0 bgcolor/0Y6A6A6A05

    -input name/0f(it0 tpe/0te"t0 id/0f(it0 85

    -8td5

    -8tr5

    -tr5

    -td +idt!/01**0 align/0rig!t0 )align/0top0 bgcolor/0Y6A6A6A05State-8td5

    -td +idt!/01940 align/0left0 )align/0top0 bgcolor/0Y6A6A6A05

    -input name/0fState0 tpe/0te"t0 id/0fState0 85

    -8td5

    -8tr5

    -tr5

    -td +idt!/01**0 align/0rig!t0 )align/0top0 bgcolor/0Y6A6A6A05Pincode-8td5

    -td +idt!/01940 align/0left0 )align/0top0 bgcolor/0Y6A6A6A05

    -input name/0fPincode0 tpe/0te"t0 id/0fPincode0 85

    -8td5

    -8tr5

    -tr5

    -td +idt!/01**0 align/0rig!t0 )align/0top0 bgcolor/0Y6A6A6A05P!one 7umber -8td5

    -td +idt!/01940 align/0left0 )align/0top0 bgcolor/0Y6A6A6A05

    -input name/0fP!one0 tpe/0te"t0 id/0fP!one0 85

    -8td5

    -8tr5

  • 7/26/2019 ip lab (2)

    59/65

    -tr5

    -td +idt!/01**0 align/0rig!t0 )align/0top0 bgcolor/0Y6A6A6A056mail ,D -em5-8em5

    -8td5

    -td +idt!/01940 align/0left0 )align/0top0 bgcolor/0Y6A6A6A05

    -input name/0f6mail0 tpe/0te"t0 id/0f6mail0 85

    -8td5

    -8tr5

    -tr5

    -td !eig!t/01

  • 7/26/2019 ip lab (2)

    60/65

    -8label5

    -8td5

    -8tr5

    -8table5

    -8form5

    -br 85

    -br 85

    -br 85

    -br 85

    -br 85

    -span class/0font1*b05

    -8span5

    -8di)5

    -di) id/0footer05

    -8di)5

    -8di)5

    -8bod5

    -8!tml5

    S'!"s-""'

    Y+rapper

    ?

    margin:auto

    +idt!: U4p"

    min3!eig!t: 9p"

    font3famil:Arial' el)etica' sans3serif

    font3siKe:1$p"

    color:Y%%%%%%

    border3left:Y%%%%%% 1p" solid

  • 7/26/2019 ip lab (2)

    61/65

    border3rig!t:Y%%%%%% 1p" solid

    border3top:Y%%%%%% 1p" solid

    border3bottom:Y%%%%%% 1p" solid

    padding:

  • 7/26/2019 ip lab (2)

    62/65

    te"t3decoration:none

    B

    .na)LinC:!o)er ?

    font3famil: Herdana' Arial' el)etica' sans3serif

    font3siKe:1$p"

    font3+eig!t: bold

    color: YUU

    te"t3decoration:underline

    B

    .font1*b ?

    font3famil:Herdana' Arial' el)etica' sans3serif

    font3siKe:1*p"

    font3+eig!t:bold

    color: Y

    B

    .tab@order ?

    border3bottom:Y 1p" solid

    border3left:Y 1p" solid

    border3top:Y 1p" solid

    border3rig!t:Y 1p" solid

    B

  • 7/26/2019 ip lab (2)

    63/65

    A+o*'Us.p-p:

    Login.p-p:

  • 7/26/2019 ip lab (2)

    64/65

    R"gis'#a'ion1#om.p-p:

    D"pa#'m"n'.p-p:

  • 7/26/2019 ip lab (2)

    65/65

    Boo;Lis'.p-p:

    O#("#.p-p: