View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   

I wrote an online class forum for classes I teach and found that students kept trying to access pages directly without first logging in. Although I fixed that with the AUTH object I decided to also find a way to hide the page in the address line. Looking around the Internet I found a free javascript that I converted to FoxPro. The code is below for your use.

 

*** START ************************

<%
LOCAL lcURL
lcURL = ""
IF Request.FormCount("btnchoice") > 0
 lcURL = ALLTRIM(Request.Form('urlpage'))

    lcURL = StrTran(lcURL,"A", "%41")
    lcURL = StrTran(lcURL,"B", "%42")
    lcURL = StrTran(lcURL,"C", "%43")
    lcURL = StrTran(lcURL,"D", "%44")
    lcURL = StrTran(lcURL,"E", "%45")
    lcURL = StrTran(lcURL,"F", "%46")
    lcURL = StrTran(lcURL,"H", "%48")
    lcURL = StrTran(lcURL,"I", "%49")
    lcURL = StrTran(lcURL,"K", "%4B")
    lcURL = StrTran(lcURL,"M", "%4D")
    lcURL = StrTran(lcURL,"N", "%4E")
    lcURL = StrTran(lcURL,"R", "%52")
    lcURL = StrTran(lcURL,"S", "%53")
    lcURL = StrTran(lcURL,"T", "%54")
    lcURL = StrTran(lcURL,"U", "%55")
    lcURL = StrTran(lcURL,"a", "%61")
    lcURL = StrTran(lcURL,"b", "%62")
    lcURL = StrTran(lcURL,"c", "%63")
    lcURL = StrTran(lcURL,"d", "%64")
    lcURL = StrTran(lcURL,"e", "%65")
    lcURL = StrTran(lcURL,"f", "%66")
    lcURL = StrTran(lcURL,"h", "%68")
    lcURL = StrTran(lcURL,"i", "%69")
    lcURL = StrTran(lcURL,"k", "%6B")
    lcURL = StrTran(lcURL,"m", "%6D")
    lcURL = StrTran(lcURL,"n", "%6E")
    lcURL = StrTran(lcURL,"o", "%6F")
    lcURL = StrTran(lcURL,"p", "%70")
    lcURL = StrTran(lcURL,"r", "%72")
    lcURL = StrTran(lcURL,"s", "%73")
    lcURL = StrTran(lcURL,"t", "%74")
    lcURL = StrTran(lcURL,"u", "%75")
    lcURL = StrTran(lcURL,"v", "%76")
    lcURL = StrTran(lcURL,"w", "%77")
    lcURL = StrTran(lcURL,"x", "%78")
 lcURL = "HTTP://"+lcURL
ENDIF
%>
<HTML>

<HEAD>
<TITLE>Hide Web Page</TITLE>
</HEAD>
<BODY>

<table>
  <tr>
    <td>
        <form name="hidewebpage" METHOD=post ACTION="URL.fwx">
   Enter a URL, without HTTP://, and a page to hide. For example,
   <BR>
   www.yourdomain.com/yourpage.fwx (or whatever your extension is)
   <BR>
   <input type="text" size="70" name="urlpage" value="">
   <BR>         
           <INPUT TYPE=SUBMIT NAME=btnchoice VALUE="Create URL">
           <BR><BR>
           Your hidden web page is:<BR>
           <%RESPONSE.WRITE(lcURL)%>
           <%lcURL = ""%>
        </form>
    </td>
  </tr>
</table>
</BODY>
</HTML>

*** END **************************