Example of a login page

The language hprg is only valid within brackets.
Remarks and documentatiion can be included easily.
Flexible webcontent can be created easily.
Dit is het startscherm bestaande uit een lijst met personen function Behandel(source,label,sIdent1,sNameSel1,iIdent2,sNameSel2,cfm) (beginscherm as html <div id="Ctop" class="vdiv"></div> <div id="C1" class="vdiv"> <h3>Welkom bij het testprogramma van hprg</h3> Om verder te gaan dient u in te loggen.<br> <form> Gebruikersnaam: <input type="text" id="l1" autofocus required maxlength="10" size="10"><br> Wachtwoord: <input type="password" id="p1" required maxlength="10" size="10"> <input type="button" value="Doorgaan" OnClick="BehandelPassWord('login','inloggen','l1','p1')"><br> </form> </div> <div id="C2" class="vdiv"></div> <div id="C3" class="vdiv"></div> <div id="C4" class="vdiv"></div> <div id="C5" class="vdiv"></div> <div id="C6" class="vdiv"></div> <div id="Cbottom" class="vdiv"></div> <div id="Clinks" class="ldiv"></div> <div id="Crechts" class="rdiv"></div> ) (beginscherm2 as html <form> Commando: <input type="text" id="x1" autofocus maxlength="40" size="10"> <input type="button" value="Doorgaan" OnClick="Behandel('login','commando','x1')"><br> <div id="CCOMMAND"></div> </form> ) (commando as function dim commando as string dim b as base dim woord as string dim args as string dim arg as string addtolog "Command start" setfromarg commando "v1" print "Het commando: " + commando set commando commando.strip addtolog "commando2: " + commando set woord commando.getword if woord == "reload" set args commando.nextafter("reload") set arg args.getword addtolog "Commmand is reload" do b.reload(arg) end settag "C2" ) (topbalk <img src="img/topbalk.png"> ) (inloggen as function dim naam as string dim crypt as string dim t as sqlresultset dim sql as string dim b as base dim key as string dim s as string dim crypt2 as string dim w as string dim id as integer setfromarg naam "v1" addtolog "Naam:" + naam setfromarg crypt "v2" 'Naam + sessionID + Wachtwoord addtolog "Achtervoegsel" + crypt set sql "select * from user where name='" + naam + "'" addtolog sql t.exec(sql) if t.first addtolog "Naam bestaat" set w t.field("passwd") set key b.sessionkey addtolog "sessionkey:" + key set s naam + key + w set crypt2 s.md5 addtolog "crypt2:" + crypt2 if crypt == crypt2 'Nu de code opbouwen set id t.field("id") addtolog "Het id is:" + id set sql "select * from rolelink where userid=" + id t.exec(sql) ifnot t.first 'Geen rol betekend de hoofdrol addtolog "crypt2: beginscherm" printclient "beginscherm2" printclient "topbalk" printclient "wrk.menu1" settag "C1" else addtolog "crypt2: nl" printclient "topbalk" printclient "wrk.menu2" settag "C1" end end else print "not ok" settag "C2" end ) (screen as function printclient "beginscherm" settag "content" ) (code as function print "Hello world 2" settag "content" )

Here is some output of the code

This is nog working!

Welkom bij het testprogramma van hprg

Om verder te gaan dient u in te loggen.
Gebruikersnaam:
Wachtwoord: