Forum Registration Disabled - Send a request to support@scriptbasic.org to join the forum.User GuideDevelopers Guide
#!/usr/bin/scriba -cINCLUDE cgi.basOPTION cgi$Method cgi::Post or cgi::GetIF cgi::RequestMethod()="GET" THEN max_tries = 5 tryno=1 mypass = ""END IFIF cgi::RequestMethod()="POST" THEN IF cgi::PostParam("mypass")="LetMeIn" THEN cgi::Header 302,"text/html" PRINT "Location: /private.html\n" cgi::FinishHeader END END IF max_tries=cgi::PostParam("max_tries") tryno=cgi::PostParam("tryno") tryno = tryno + 1 IF tryno > val(max_tries) THEN cgi::Header 302,"text/html" PRINT "Location: /home.html\n" cgi::FinishHeader END END IF END IFcgi::Header 200,"text/html"cgi::FinishHeaderPRINT """<html>Try number """ & tryno & """<br>Enter Passsword:<form method=post action=/cgi-bin/getpswd.bas> <input type=password name=mypass size=10> <input type=submit value="Go"> <input type=hidden name=max_tries value=""" & max_tries & """> <input type=hidden name=tryno value=""" & tryno & """></form></html>"""END--------------------------[home.html]------------------------------<html><h1>Home Page</h1></html>--------------------------[private.html]----------------------------<html><h1>Private Page</h1></html>