Solved

Looking for a way to hide url information?

Posted on 2004-04-21
18
300 Views
Last Modified: 2007-12-19
I am programming my site with coldfusion but I'm wondering if there is a way with javascript to hide what information is passed in the url.
So say I'm doing a recordset and the user clicks "next page", then the url may look something like this:

http://www.mysite.com/site/index.cfm?var1=column1&var2=column2&searchVar=Joe&Startrow=11

How could I hide this from the user when the information is passed? Is there a way to do this?
And then if there is a way to say encrypt it or hide it, then how would I pull the information back out then from the url to be used in my page?
Basically just want to hide the info and it still able to be used in my pages, the user just can't see what's going on in the url.

Greatly appreciate any help, thanks!!

Regards,
~trail
0
Comment
Question by:trailblazzyr55
  • 9
  • 4
  • 3
  • +1
18 Comments
 
LVL 3

Expert Comment

by:fave_17
Comment Utility
you can use the POST method in the form
0
 
LVL 3

Expert Comment

by:fave_17
Comment Utility
<form action="sample.html" method="post">
...
</form>

by the way, are you using forms to pass information?
0
 
LVL 30

Expert Comment

by:third
Comment Utility
use frames or iframe.
0
 
LVL 30

Expert Comment

by:third
Comment Utility
another is by opening your page as a child window. but generally, you cannot really hide the URL.
0
 
LVL 20

Author Comment

by:trailblazzyr55
Comment Utility
I'm using sessions with coldfusion, cfcase/cfswitch, to run through a entry form, and then onSubmit I'm using cflocation. This gets me to me results page no problem, and doesn't show anything in the url, but the page address. But when I'm pagin through is when I get the var's in the url cause I need to pass the var's while paging. I'm using the post method to get from search page to results page, from then from there when I do the pagin is when I need to hide the url. Frames would work, but I'm trying to avoid frames with this page if all possible. Any ideas from there?

Thanks for your help!

Regards,
~trail
0
 
LVL 20

Author Comment

by:trailblazzyr55
Comment Utility
Ahh correction, from my search page yeah I'm using the post, forget the other cftags I mentioned above.. sorry...
Just want to protect the url when paging..

Thanks,
Regards,
~trail
0
 
LVL 20

Author Comment

by:trailblazzyr55
Comment Utility
I saw this on a question just now, but not too sure how it works???

Here's the question I saw: http://www.experts-exchange.com/Web/Q_20709008.html


And heres the script,

<HTML>
<HEAD>
<TITLE></TITLE>
<script language="Javascript" >

function doSubmit(string)
{
    //"id=3456&server=myserver&company=Sampson & Sons Too"
     var str = "id=" + encodeURI(encrypt("3456")) + "&" + "server="  + encodeURI(encrypt("myserver"))
               + "&" + "company=" + encrypt("Sampson & Sons Too");
     main.action = "http://localhost/testweb/encrypt.asp?" + str;
     main.submit();
}

function encrypt(url){
   
     var letter;
     var encrypt = "";

                var len  = url.length;
                for (var i = 0;i < len;i++) {
         letter = url.charAt(i);
          encrypt = encrypt + String.fromCharCode(Asc(letter)-12)
     }
     
     return encrypt;    
}

function Asc(string)
{
     var symbols = " !\"#$%&'()*+'-./0123456789:;<=>?@";
     var loAZ = "abcdefghijklmnopqrstuvwxyz";
     symbols += loAZ.toUpperCase();
     symbols += "[\\]^_`";
     symbols += loAZ;
     symbols += "{|}~";
     var loc;
     loc = symbols.indexOf(string);
     if (loc > -1)
     {
          Ascii_Decimal = 32 + loc;
          return (32 + loc);
     }
     return (0);
}

</script >
</HEAD>
<BODY>

<form id="main" method="POST">
<input type=button onclick="doSubmit()" value="test" >
</form>

</BODY>
</HTML>
______________________________
on the server:
<%@ Language=VBScript %>

<%
    id = request.querystring("id")
    serv = request.querystring("server")
    company = request.querystring("company")
    Response.Write decrypt(id) & " " &  decrypt(serv) & " " & decrypt(company)
     
     function decrypt(str)
          s = ""
          For i = 1 To Len(str)
               s = s & Chr(Asc(Mid(str, i, 1))+12)
          Next
          decrypt = s
     end function
     
%>



What would this do for me?
Thanks for your help!
Regards
~trail
0
 
LVL 30

Expert Comment

by:third
Comment Utility
this code i guess does want you want. you can implement it only that you have to convert those vbscript/asp code to CF. sorry but i don't know CF.
0
 
LVL 20

Author Comment

by:trailblazzyr55
Comment Utility
how are urls like this produced:

http://www.studiowhiz.com/forums/index.php?s=9bdfe2142aa9317aaf58789d971d54da&showtopic=6493&st=0&#entry56939

Would this url use the same idea as the javascript above?

Thanks for your suggestions!
Regards,
~trail
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Accepted Solution

by:
tomwoods earned 500 total points
Comment Utility
Ok. Here are the Url Encryption / Decryption functions for ColdFusion. Hope you
find them usefull
/*********************************************************/

<cfscript>
/**
 * Add security by encrypting and decrypting URL variables.
 *
 * @param cQueryString        Query string to encrypt. (Required)
 * @param nKey        Key to use for encryption. (Required)
 * @return Returns an encrypted query string.
 * @author Timothy Heald (theald@schoollink.net)
 * @version 2, February 19, 2003
 */
function urlEncrypt(queryString, key){
      // encode the string
      var uue = cfusion_encrypt(queryString, key);
       
      // make a checksum of the endoed string
      var checksum = left(hash(uue & key),2);
       
      // assemble the URL
      queryString = "/" & uue & checksum &"/index.htm";
            
      return queryString;
}
</cfscript>

Usage Example:
/*********************************************************/
<CFSET Name = "Ray">
<CFSET Age = 28>
<CFSET Key = "MySecretBlah348123190">
<CFSET QS = "name=#Name#&age=#Age#">
<CFOUTPUT>
Link will be, foo.cfm#URLEncrypt(QS,key)#
</CFOUTPUT>


Decryption Function
/*********************************************************/

<cfscript>
/**
 * Add security by encrypting and decrypting URL variables. See URLEncrypt.
 * Mod by David Heard - added decode
 *
 * @param nKey        The encryption key to use. (Required)
 * @param QueryString        Defaults to CGI.Query_String (Optional)
 * @return Writes to the URL scope.
 * @author Timothy Heald (theald@schoollink.net)
 * @version 3, October 9, 2002
 */
function urlDecrypt(key){
      var queryString = cgi.path_info;
      var scope = "url";
      var stuff = "";
      var oldcheck = "";
      var newcheck = "";
      var i = 0;
      var thisPair = "";
      var thisName = "";
      var thisValue = "";

      // see if a scope is provided if it is set it otherwise set it to url
      if(arrayLen(arguments) gt 1){
            scope = arguments[2];
      }

      if ((right(queryString,3) neq "htm") or (findNoCase("&",queryString) neq 0) or (findNoCase("=",queryString) neq 0)){
            stuff = '<FONT color="red">not encrypted, or corrupted url</FONT>';
      } else {
      
            // remove /index.htm
            querystring = replace(queryString, right(queryString,10),'');
            
            // remove the leading slash
            querystring = replace(queryString, left(queryString,1),'');
            
            // grab the old checksum
           if (len(querystring) GT 2) {
               oldcheck = right(querystring, 2);
               querystring = rereplace(querystring, "(.*)..", "\1");
           }
           
           // check the checksum
           newcheck = left(hash(querystring & key),2);
           if (newcheck NEQ oldcheck) {
               return querystring;
           }
           
           //decrypt the passed value
            queryString = cfusion_decrypt(queryString, key);
            
                  // set the variables
                  for(i = 0; i lt listLen(queryString, '&'); i = i + 1){
                        
                        // Break up the list into seprate name=value pairs
                        thisPair = listGetAt(queryString, i + 1, '&');
                        
                        // Get the name
                        thisName = listGetAt(thisPair, 1, '=');
                        
                        // Get the value
                        thisValue = listGetAt(thisPair, 2, '=');
                        
                        // Set the name with the scope
                        thisName = scope & '.' & thisName;
                        
                        // Set the variable
                        setVariable(thisName, thisValue);
                  }
            
      }
      
      return stuff;
}
</cfscript>

Usage Example:
/*********************************************************/
<CFSET Name = "Ray">
<CFSET Age = 28>
<CFSET Key = "MySecretBlah348123190">
<CFSET QS = "name=#Name#&age=#Age#">
<CFSET QS = URLEncrypt(QS,key)>
<CFOUTPUT>
QueryString is #QS#<P>
</CFOUTPUT>
<CFSET URLDecrypt(Key,QS)>
Dump of URL scope:
<CFDUMP VAR="#URL#">


If you find that this resource answers your question, you can rate it now. Cheers.
Tom
0
 
LVL 20

Author Comment

by:trailblazzyr55
Comment Utility
Tom,

Thanks for that resource! That looks like exactly what I'm looking for!! I've been playing around with it and can't seem to get it to work, I'm trying to use it to hide the variables when I'm doing the recordset paging would you mind taking a look at what I have and see if you could offer any assistance???

Thanks for your help!!

Here's my pahe I'm trying to apply it to, it's pretty long, the paging portion is all towards the bottom....

<CFQUERY NAME="QryGetColumnData" DATASOURCE="#DataSource#">
                  SELECT     *
                  FROM         Mac INNER JOIN
                                        IPdata ON Mac.MacID = IPdata.MacID INNER JOIN
                                        Owner ON Mac.OwnerMacID = Owner.OwnMacID
                  <cfswitch expression="#searchbutton#">  
                      <cfcase value="MacAdd">
                           WHERE
                              <cfif NOT IsDefined("URL.varoutput")>(Mac.MacAdd = '#FORM.sC1#')
                              <cfset varoutput = "#FORM.sC1#">
                              <cfelse>(Mac.MacAdd = '#URL.varoutput#')</cfif>
                              <cfset labelOutput = "MAC Address">
                      </cfcase>
                      <cfcase value="IPAdd">
                        WHERE
                              <cfif NOT IsDefined("URL.varoutput")>(IPdata.IPAdd = '#FORM.sC2#')
                              <cfset varoutput = "#FORM.sC2#">
                              <cfelse>(IPdata.IPAdd = '#URL.varoutput#')</cfif>
                              <cfset labelOutput = "Static IP Address">
                      </cfcase>
                         <cfcase value="MacSwRtr">
                           WHERE
                              <cfif NOT IsDefined("URL.varoutput")>(Mac.MacSwRtr LIKE '%#FORM.sC3#%')
                              <cfset varoutput = "#FORM.sC3#">
                              <cfelse>(Mac.MacSwRtr LIKE '%#URL.varoutput#%')</cfif>
                              <cfset labelOutput = "Switch/Router">
                      </cfcase>
                      <cfcase value="OwnMacName">
                           WHERE
                              <cfif NOT IsDefined("URL.varoutput")>(Owner.OwnMacName LIKE '%#FORM.sC#%')
                              <cfset varoutput = "#FORM.sC#">
                              <cfelse>(Owner.OwnMacName LIKE '%#URL.varoutput#%')</cfif>
                              <cfset labelOutput = "Machine Name">
                      </cfcase>
                        <cfcase value="IPMask">
                        WHERE
                              <cfif NOT IsDefined("URL.varoutput")>(IPdata.IPMask = '#FORM.sC6#')
                              <cfset varoutput = "#FORM.sC6#">
                              <cfelse>(IPdata.IPMask = '#URL.varoutput#')</cfif>
                              <cfset labelOutput = "Subnet Mask Address">
                      </cfcase>
                         <cfcase value="IPGtwy">
                           WHERE
                              <cfif NOT IsDefined("URL.varoutput")>(IPdata.IPGtwy = '#FORM.sC5#')
                              <cfset varoutput = "#FORM.sC5#">
                              <cfelse>(IPdata.IPGtwy = '#URL.varoutput#')</cfif>
                              <cfset labelOutput = "Gateway Address">
                      </cfcase>
                      <cfcase value="IPType">
                           WHERE
                              <cfif NOT IsDefined("URL.varoutput")>(IPdata.IPType = 'DHCP')
                              <cfset varoutput = "DHCP">
                              <cfelse>(IPdata.IPType = '#URL.varoutput#')</cfif>
                              <cfset labelOutput = "DHCP IP Address">
                      </cfcase>
                  </cfswitch>
                              ORDER BY Owner.OwnMacName DESC
          </CFQUERY>
<cfif IsDefined("Form.PageCount")>
<cfset listCount = #Form.PageCount#>
<cfelseif IsDefined("URL.listCount")>
<cfset listCount = #URL.listCount#>
</cfif>
<CFSET OnEachPage = #listCount#>
<CFPARAM NAME = "StartRow" DEFAULT = "1">
<CFSET EndRow = StartRow + OnEachPage - 1>
<CFIF EndRow GTE QryGetColumnData.RecordCount>
     <CFSET EndRow = QryGetColumnData.RecordCount>
     <CFSET Next = false>
<!--- Othereise, set Next to true and determine the next set of records. --->
<CFELSE>
     <CFSET Next = true>
     <CFIF EndRow + OnEachPage GT QryGetColumnData.RecordCount>
          <CFSET NextNum = QryGetColumnData.RecordCount - EndRow>
     <CFELSE>
          <CFSET NextNum =  OnEachPage>
     </CFIF>
     <CFSET NextStart = EndRow + 1>
</CFIF>
<!--- If StartRow is 1, set Previous to false. --->
<CFIF StartRow IS 1>
     <CFSET Previous = false>
<!--- Othewise, determine the previous set of records. --->
<CFELSE>
     <CFSET Previous = true>
     <CFSET PreviousStart = StartRow - OnEachPage>
</CFIF>
<CFSET NumPages = Ceiling(QryGetColumnData.RecordCount / OnEachPage)>
<CFPARAM NAME = "PageNum" DEFAULT = "1">



<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>System Information Database</title>
<META NAME="description" CONTENT="Information Tracker">
<META NAME="author" CONTENT="Adam Leszinski">
<META NAME="copyright" CONTENT="Adam Leszinski">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

<style type="text/css">
<!--
.style1 {
      font-family: Arial, Helvetica, sans-serif;
      font-weight: bold;
      font-size: 14px;
      color: #7199BC;
}
.style2 {font-size: 16px}
.style3 {
      font-size: 14px;
      font-weight: bold;
}
.style4 {font-size: 12px}
.style10 {color: #006666; font-weight: bold; }
.style11 {color: #FF0000}
.style16 {font-size: 18px; font-weight: bold; font-family: Arial, Helvetica, sans-serif; }
.style18 {
      color: #006633;
      font-weight: bold;
      font-family: Arial, Helvetica, sans-serif;
}
.style19 {color: #FF3300}
.style20 {font-family: Arial, Helvetica, sans-serif}
.style21 {font-size: 14px}
.style22 {font-size: 14}
-->
</style>
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('img/main2.jpg','img/insert2.jpg','img/edit2.jpg','img/stats2.jpg','img/display2.jpg')">

<table border="0" width="100%" cellspacing="0" cellpadding="0" background="img/bluespeck.jpg">
  <tr>
    <td width="37%" height="74">
    <p align="left"><img src="img/topleft1.jpg" width="300" height="74" align="top"></td>
    <td width="63%" valign="bottom">
    <p align="right"><img src="img/pic238756.jpg" width="235" height="75" align="top"></td>
  </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0" background="img/bluebkg.jpg">
  <tr>
    <td height="29" background="img/backbar.jpg">&nbsp;</td>
  </tr>
  <tr>
    <td width="99%">
    <p align="center">&nbsp;&nbsp;&nbsp;&nbsp; <a href="index.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('main','','img/main2.jpg',1)"><img src="img/main1.jpg" alt="Main" name="main" width="74" height="22" border="0"></a> <a href="insert.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Insert','','img/insert2.jpg',1)"> <img src="img/insert1.jpg" alt="Insert" name="Insert" width="74" height="22" border="0"></a> <a href="search.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Search','','img/search2.jpg',1)"><img src="img/search1.jpg" alt="Search" name="Search" width="74" height="22" border="0"></a> <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Stats','','img/stats2.jpg',1)"> <img src="img/stats1.jpg" alt="Stats" name="Stats" width="74" height="22" border="0"></a> <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Display','','img/display2.jpg',1)"> <img src="img/display1.jpg" alt="Display" name="Display" width="74" height="22" border="0"></a></td>
  </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="2%" background="img/sidebkg.jpg" valign="top"><img border="0" src="img/sidebkg.jpg" width="25" height="12"></td>
    <td width="80%" valign="top">
      <p style="margin-left: 20">&nbsp;</p>
      <p align="center" style="margin-left: 20">
        
<cfif IsDefined("Form.cBox")>
<cfset listVars = #Form.cBox#>
<cfelseif IsDefined("URL.listVars")>
<cfset listVars = #URL.listVars#>
</cfif>


<cfif QryGetColumnData.recordCount EQ 0>
 
      <cfoutput><span class="style16">No records were found for <span class="style19">#varoutput#</span> in category "<span class="style19">#labelOutput#</span>"!</span></cfoutput>
      <div align="center"><BR>
        <span class="style18">Search Again?</span> [<a href="search.cfm">Yes</a>] [<a href="index.cfm">No</a>] </div>
      
      <cfelseif IsDefined("listVars") AND #QryGetColumnData.recordCount# GTE 1>
     <CFPARAM name="Lst_Columns" default="">
       <CFPARAM name="Lst_Headings" default="">
     <CFLOOP LIST="#listVars#" INDEX="Column_Index">
          <CFSET Lst_Columns = ListAppend(Lst_Columns,ListLast(Column_Index,'~'))>
          <CFSET Lst_Headings = ListAppend(Lst_Headings,ListFirst(Column_Index,'~'))>
     </CFLOOP>

     <div align="center">
  <TABLE WIDTH="813" BORDER="0" align="center" bgcolor="#FFFFFF">
         <TR>
                         <TD width="281"><span class="style11"><strong>Column Order:</strong>&nbsp;</span></TD>
              <CFLOOP list="#Lst_Headings#" index="Heading_Index">
                <TD width="313" height="21"><div align="center" class="style10"><CFOUTPUT>"#Heading_Index#"</CFOUTPUT></div>
                </TD>
              </CFLOOP>
                          <TD width="205"><div align="center" class="style10">"Update/Delete"</div></TD>
         </TR>
  </TABLE>
  <BR><cfoutput>
  <div align="center">(<span class="style20"><span class="style4"><span class="style21"><span class="style22"><strong>#QryGetColumnData.recordcount#</strong>) <strong>Results found...</strong></span></span></span></span></div>
</cfoutput><BR>
  <TABLE BORDER="0" WIDTH="937" cellpadding="4" cellspacing="0">             
 
   
<CFOUTPUT query="QryGetColumnData" StartRow="#startrow#" MaxRows="#OnEachPage#">
<cfif CurrentRow MOD 2 IS 1>
          <cfset bgcolor ="CCFFFF">
                <cfelse>
          <cfset bgcolor ="CCCCCC">
    </cfif>
   
          <TR bgcolor = "#bgcolor#">
                 <CFLOOP list="#Lst_Columns#" index="Col_Index">
                      <TD width="467"><div align="left" class="style4">
                        <div align="center"><strong><font face="Arial, Helvetica, sans-serif">#Evaluate("QryGetColumnData.#Col_Index#")#</font></strong></div>
                      </div></TD>
                        
                         </CFLOOP>
                         <TD width="454"><div align="center">
                         <a href="details.cfm?keyID=#QryGetColumnData.OwnMacID#">[Details]</a>
                         <a href="update.cfm?keyID=#QryGetColumnData.OwnMacID#">[ Edit ]</a>
                         <a href="delete.cfm?keyID=#QryGetColumnData.OwnMacID#">[Delete]</a>
                           </div></TD>
              </TR>
         </CFOUTPUT>
  </TABLE>
     </div>
        </CFIF>
        
        <div align="center">
            
        <p>&nbsp;</p>
        <TABLE BORDER = "0">
       <TR>
          <TD VALIGN = "top">
               <!--- If Previous is true, display the previous link. --->
               <CFIF Previous>
                    <CFOUTPUT>
                         <A HREF = "results.cfm?listVars=#listVars#&varoutput=#varoutput#&listCount=#listCount#<CFIF IsDefined("searchbutton")>&searchbutton=#URLEncodedFormat(searchbutton)#</CFIF>&StartRow=#PreviousStart#&PageNum=#DecrementValue(PageNum)#"><< Previous</A>
                    </CFOUTPUT>
               <CFELSE>
                     
               </CFIF>
          </TD>
          <CFLOOP FROM = "1" TO = "#NumPages#" INDEX = "ThisPage">
               <CFOUTPUT>
                    <CFIF ThisPage IS PageNum>
                         <TD>#ThisPage#</TD>
                    <CFELSE>
                         <CFSET PageNumStart = (((ThisPage - 1) * OnEachPage) + 1)>
                         <TD><A HREF = "results.cfm?listVars=#listVars#&varoutput=#varoutput#&listCount=#listCount#<CFIF IsDefined("searchbutton")>&searchbutton=#URLEncodedFormat(searchbutton)#</CFIF>&StartRow=#PageNumStart#&PageNum=#ThisPage#">#ThisPage#</A></TD>
                    </CFIF>
               </CFOUTPUT>
          </CFLOOP>
          <TD VALIGN = "top">
               <!--- If Next is true, display the previous link. --->
               <CFIF Next>
                    <CFOUTPUT>
                         <A HREF = "results.cfm?listVars=#listVars#&varoutput=#varoutput#&listCount=#listCount#<CFIF IsDefined("searchbutton")>&searchbutton=#URLEncodedFormat(searchbutton)#</CFIF>&StartRow=#NextStart#&PageNum=#IncrementValue(PageNum)#">Next >></A>
                    </CFOUTPUT>
               <CFELSE>
                     
               </CFIF>
          </TD>
     </TR>
</Table>
            
            </p>
        <p><a href="search.cfm">[New Search]</a></p>
        <p>&nbsp;</p>
        </div>
    </td>
    <td width="18%" valign="top">
      <table border="0" width="100%" bgcolor="#FFFFCC" cellspacing="0" cellpadding="0">
        <tr>
          <td width="100%" height="172" bgcolor="#FFFFCC"><div align="center" class="style1"><br><span class="style2">Network Administrator</span><br>
            <img src="img/lilguy.jpg" width="100" height="100"><font size="1"><br>
          </font></div>
          </td>
        </tr>
      </table>
      <table border="0" width="100%" bgcolor="#78A0C0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="100%" height="25"><div align="center" class="style3"><font face="Arial" color="#FFFFCC">Current Screen</font> </div></td>
        </tr>
      </table>
      <table border="0" width="100%" bgcolor="#DCE7EF" cellspacing="0" cellpadding="0">
      <cfif QryGetColumnData.recordCount EQ 0>  
        <tr>
          <td width="100%" height="53"><p align="center" style="margin-left: 10"><font face="Arial" size="2"><strong>No Results!</strong> <br>
          </font></td>
        </tr>
      <cfelse>
          <tr>
          <td width="100%" height="53"><p align="center" style="margin-left: 10"><font face="Arial" size="2"><strong>Search Results </strong> <br><cfoutput>Current Page (#PageNum#)</cfoutput>
          </font></td>
        </tr>
      </cfif>
      </table>
      <table border="0" width="100%" bgcolor="#78A0C0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="100%" height="25"><div align="center" class="style3"><font face="Arial" color="#FFFFCC">Step</font></div></td>
        </tr>
      </table>
      <table width="100%" height="54" border="0" cellpadding="0" cellspacing="0" bgcolor="#DCE7EF">
       <cfif QryGetColumnData.recordCount EQ 0>
        <tr>
          <td width="100%" height="50"><p align="center" style="margin-left: 10"><font face="Arial" size="2">No Results! &nbsp; </font></td>
        </tr>
       <cfelse>
            <tr>
          <td width="100%" height="50"><p align="center" style="margin-left: 10"><font face="Arial" size="2"><CFOUTPUT>Records #StartRow# to #EndRow# of #QryGetColumnData.RecordCount#.</CFOUTPUT> &nbsp; </font></td>
        </tr>
       </cfif>
      </table>
    </td>
  </tr>
</table>

<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#7199BC"><div align="center">&copy;2004 Adam Leszinski </div></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>

</html>


Thanks again!
B'regards
~trail
0
 
LVL 1

Expert Comment

by:tomwoods
Comment Utility
Ok. of what I can see from your script, you havent defined the functions yet. If this is your encryption page, insert the urlEncrypt code at the top of your code, then every time you wish to encrypt a url just go:

<a href="http://yourpage.com/whatever.cfm#URLEncrypt('this=example&it=isgood','someKeyth4t-u-use-2-encrypt')#">link</a>

easy as pie.

if you want to decrypt, you have to insert the decrypt function on the top of you page, and then load the URL to a variable. In coldfusion, I think its something like this:

<CFSET URLENC= "#URL#">
<CFSET DECRYPTED = URLDecrypt('someKeyth4t-u-use-2-encrypt',URLENC)>
<CFDUMP VAR="#DECRYPTED#">

Try it out and show me the output. Cheers.

0
 
LVL 20

Author Comment

by:trailblazzyr55
Comment Utility
Alright I think I'm getting the hang of it here

So now I'm trying to find a way to get the variables out of my string when they are decrypted.

This is what I got...

Top of page:

<cfif IsDefined("URL.id")>
<cfset id    = #url.id#>
<cfset Key  = "1234567890">
<cfset id    = decrypt(id, key)>
</cfif>


Bottom by paging links:

<cfset Key  = "1234567890">
<cfset string = "listVars=#listVars#&varoutput=#varoutput#&listCount=#listCount#&searchbutton=#URLEncodedFormat(searchbutton)#"

<cfset id  = Encrypt(string,Key)>

Links to be encrypted:

</CFIF>
          </TD>
          <CFLOOP FROM = "1" TO = "#NumPages#" INDEX = "ThisPage">
               <CFOUTPUT>
                    <CFIF ThisPage IS PageNum>
                         <TD>#ThisPage#</TD>
                    <CFELSE>
                         <CFSET PageNumStart = (((ThisPage - 1) * OnEachPage) + 1)>
                         <TD><A HREF = "results.cfm?id=#id#&StartRow=#PageNumStart#&PageNum=#ThisPage#">
                                  #ThisPage#
                                 </A></TD>
                    </CFIF>
               </CFOUTPUT>
          </CFLOOP>
          <TD VALIGN = "top">
               <!--- If Next is true, display the previous link. --->
               <CFIF Next>
                    <CFOUTPUT>
                         <A HREF = "results.cfm?id=#id#&StartRow=#NextStart#&PageNum=#IncrementValue(PageNum)#">
                         Next >>
                         </A>
                    </CFOUTPUT>
               <CFELSE>
                     
               </CFIF>




So now how would get the list of variables out of the sting when the link is clicked?

what I mean is, say now the string is decrypted in the top of my page..
I need to get ....

listVars=#listVars#
varoutput=#varoutput#
listCount=#listCount#
searchbutton=#URLEncodedFormat(searchbutton)#

For use in the page
Out of the decrypted string.....


string = "listVars=#listVars#&varoutput=#varoutput#&listCount=#listCount#&searchbutton=#URLEncodedFormat(searchbutton)#"

Is there a way I can then extract these 4 variables once the string is decrypted, so then they are 4 individual variables?

Thanks for your help!

Regards,
~trail
0
 
LVL 1

Expert Comment

by:tomwoods
Comment Utility
Remeber that you are dealing with an array. First decrypt the #URL# and THEN access each individual variable (in your example, and individual variable would be URL.id)
0
 
LVL 20

Author Comment

by:trailblazzyr55
Comment Utility
It's hard to explain, with out showing you what I'm getting on my screen, but whenever I add the encryption to my url, the link comes up with the encryption as well. Not if I said that very well??

Lets say if I use this:

<cfset Key  = "1234567890">
<cfset string = "listVars=#listVars#&varoutput=#varoutput#&listCount=#listCount#&searchbutton=#URLEncodedFormat(searchbutton)#"
<cfset id  = Encrypt(string,Key)>

Then my link looks like
<A HREF = "results.cfm?id=#id#&StartRow=#PageNumStart#&PageNum=#ThisPage#">#ThisPage#</A>

Then on the actual page in the browser, the encrytion come out in the page for some reason, but it's displayed as a link??? And it doesn't show in the url where is should be?? I don't understand

Thanks for your help!
0
 
LVL 20

Author Comment

by:trailblazzyr55
Comment Utility
to tomwoods

I haven't forgot about your post, I'm still playing around with it when I have a few extra minutes, if I can get this working, I'll post the working script as I applied it to what I have (for others ref.) and the points go to you. Appreciate your help!! Thanks,

Regards,
~trail
0
 
LVL 1

Expert Comment

by:tomwoods
Comment Utility
Sounds great. Good luck with your coding!
t
0
 
LVL 20

Author Comment

by:trailblazzyr55
Comment Utility
Thanks Tom, got that working, your script was a big help! Sorry it took a bit to get back to ya..

Thanks again,

regards,
~trail
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now