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
Welkom bij het testprogramma van hprg
Om verder te gaan dient u in te loggen.
)
(beginscherm2 as html
)
(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
)
(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.