trailblazzyr55
asked on
Looking for a way to hide url information?
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
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
you can use the POST method in the form
<form action="sample.html" method="post">
...
</form>
by the way, are you using forms to pass information?
...
</form>
by the way, are you using forms to pass information?
use frames or iframe.
another is by opening your page as a child window. but generally, you cannot really hide the URL.
ASKER
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
Thanks for your help!
Regards,
~trail
ASKER
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
Just want to protect the url when paging..
Thanks,
Regards,
~trail
ASKER
I saw this on a question just now, but not too sure how it works???
Here's the question I saw: https://www.experts-exchange.com/questions/20709008/Encrypting-Information-in-a-URL.html
And heres the script,
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="Javascript" >
function doSubmit(string)
{
//"id=3456&server=myserver &company=S ampson & Sons Too"
var str = "id=" + encodeURI(encrypt("3456")) + "&" + "server=" + encodeURI(encrypt("myserve r"))
+ "&" + "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(le tter)-12)
}
return encrypt;
}
function Asc(string)
{
var symbols = " !\"#$%&'()*+'-./0123456789 :;<=>?@";
var loAZ = "abcdefghijklmnopqrstuvwxy z";
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("serve r")
company = request.querystring("compa ny")
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
Here's the question I saw: https://www.experts-exchange.com/questions/20709008/Encrypting-Information-in-a-URL.html
And heres the script,
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="Javascript" >
function doSubmit(string)
{
//"id=3456&server=myserver
var str = "id=" + encodeURI(encrypt("3456"))
+ "&" + "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(le
}
return encrypt;
}
function Asc(string)
{
var symbols = " !\"#$%&'()*+'-./0123456789
var loAZ = "abcdefghijklmnopqrstuvwxy
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("serve
company = request.querystring("compa
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
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.
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.MacA dd = '#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.I PAdd = '#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.MacS wRtr 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.Ow nMacName 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.I PMask = '#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.I PGtwy = '#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.I PType = '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.RecordCou nt>
<CFSET EndRow = QryGetColumnData.RecordCou nt>
<CFSET Next = false>
<!--- Othereise, set Next to true and determine the next set of records. --->
<CFELSE>
<CFSET Next = true>
<CFIF EndRow + OnEachPage GT QryGetColumnData.RecordCou nt>
<CFSET NextNum = QryGetColumnData.RecordCou nt - 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.R ecordCount / 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.o Src;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_pre loadImages .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&&p arent.fram es.length) {
d=parent.frames[n.substrin g(p+1)].do cument; 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.len gth;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.arg uments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+= 3)
if ((x=MM_findObj(a[i]))!=nul l){documen t.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.jp g','img/ed it2.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.jp g">
<tr>
<td height="29" background="img/backbar.jp g"> < /td>
</tr>
<tr>
<td width="99%">
<p align="center">   ; &nb sp; <a href="index.cfm" onMouseOut="MM_swapImgRest ore()" 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_swapImgRest ore()" onMouseOver="MM_swapImage( 'Insert',' ','img/ins ert2.jpg', 1)"> <img src="img/insert1.jpg" alt="Insert" name="Insert" width="74" height="22" border="0"></a> <a href="search.cfm" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'Search',' ','img/sea rch2.jpg', 1)"><img src="img/search1.jpg" alt="Search" name="Search" width="74" height="22" border="0"></a> <a href="#" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'Stats','' ,'img/stat s2.jpg',1) "> <img src="img/stats1.jpg" alt="Stats" name="Stats" width="74" height="22" border="0"></a> <a href="#" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'Display', '','img/di splay2.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.jp g" valign="top"><img border="0" src="img/sidebkg.jpg" width="25" height="12"></td>
<td width="80%" valign="top">
<p style="margin-left: 20"> </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.recordCou nt EQ 0>
<cfoutput><span class="style16">No records were found for <span class="style19">#varoutput #</span> in category "<span class="style19">#labelOutp ut#</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.recordCo unt# GTE 1>
<CFPARAM name="Lst_Columns" default="">
<CFPARAM name="Lst_Headings" default="">
<CFLOOP LIST="#listVars#" INDEX="Column_Index">
<CFSET Lst_Columns = ListAppend(Lst_Columns,Lis tLast(Colu mn_Index,' ~'))>
<CFSET Lst_Headings = ListAppend(Lst_Headings,Li stFirst(Co lumn_Index ,'~'))>
</CFLOOP>
<div align="center">
<TABLE WIDTH="813" BORDER="0" align="center" bgcolor="#FFFFFF">
<TR>
<TD width="281"><span class="style11"><strong>Co lumn Order:</strong> </spa n></TD>
<CFLOOP list="#Lst_Headings#" index="Heading_Index">
<TD width="313" height="21"><div align="center" class="style10"><CFOUTPUT> "#Heading_ Index#"</C FOUTPUT></ div>
</TD>
</CFLOOP>
<TD width="205"><div align="center" class="style10">"Update/De lete"</div ></TD>
</TR>
</TABLE>
<BR><cfoutput>
<div align="center">(<span class="style20"><span class="style4"><span class="style21"><span class="style22"><strong>#Q ryGetColum nData.reco rdcount#</ strong>) <strong>Results found...</strong></span></ span></spa n></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><fo nt face="Arial, Helvetica, sans-serif">#Evaluate("Qry GetColumnD ata.#Col_I ndex#")#</ font></str ong></div>
</div></TD>
</CFLOOP>
<TD width="454"><div align="center">
<a href="details.cfm?keyID=#Q ryGetColum nData.OwnM acID#">[De tails]</a>
<a href="update.cfm?keyID=#Qr yGetColumn Data.OwnMa cID#">[ Edit ]</a>
<a href="delete.cfm?keyID=#Qr yGetColumn Data.OwnMa cID#">[Del ete]</a>
</div></TD>
</TR>
</CFOUTPUT>
</TABLE>
</div>
</CFIF>
<div align="center">
<p> </p>
<TABLE BORDER = "0">
<TR>
<TD VALIGN = "top">
<!--- If Previous is true, display the previous link. --->
<CFIF Previous>
<CFOUTPUT>
<A HREF = "results.cfm?listVars=#lis tVars#&var output=#va routput#&l istCount=# listCount# <CFIF IsDefined("searchbutton")> &searchbut ton=#URLEn codedForma t(searchbu tton)#</CF IF>&StartR ow=#Previo usStart#&P ageNum=#De crementVal ue(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=#lis tVars#&var output=#va routput#&l istCount=# listCount# <CFIF IsDefined("searchbutton")> &searchbut ton=#URLEn codedForma t(searchbu tton)#</CF IF>&StartR ow=#PageNu mStart#&Pa geNum=#Thi sPage#">#T hisPage#</ A></TD>
</CFIF>
</CFOUTPUT>
</CFLOOP>
<TD VALIGN = "top">
<!--- If Next is true, display the previous link. --->
<CFIF Next>
<CFOUTPUT>
<A HREF = "results.cfm?listVars=#lis tVars#&var output=#va routput#&l istCount=# listCount# <CFIF IsDefined("searchbutton")> &searchbut ton=#URLEn codedForma t(searchbu tton)#</CF IF>&StartR ow=#NextSt art#&PageN um=#Increm entValue(P ageNum)#"> Next >></A>
</CFOUTPUT>
<CFELSE>
</CFIF>
</TD>
</TR>
</Table>
</p>
<p><a href="search.cfm">[New Search]</a></p>
<p> </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.recordCou nt 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></t d>
</tr>
</table>
<table width="100%" height="54" border="0" cellpadding="0" cellspacing="0" bgcolor="#DCE7EF">
<cfif QryGetColumnData.recordCou nt EQ 0>
<tr>
<td width="100%" height="50"><p align="center" style="margin-left: 10"><font face="Arial" size="2">No Results! </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.RecordCo unt#.</CFO UTPUT> </font></td>
</tr>
</cfif>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#7199BC"><div align="center">©2004 Adam Leszinski </div></td>
</tr>
</table>
<p> </p>
</body>
</html>
Thanks again!
B'regards
~trail
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")
<cfset varoutput = "#FORM.sC1#">
<cfelse>(Mac.MacAdd = '#URL.varoutput#')</cfif>
<cfset labelOutput = "MAC Address">
</cfcase>
<cfcase value="IPAdd">
WHERE
<cfif NOT IsDefined("URL.varoutput")
<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")
<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")
<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")
<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")
<cfset varoutput = "#FORM.sC5#">
<cfelse>(IPdata.IPGtwy = '#URL.varoutput#')</cfif>
<cfset labelOutput = "Gateway Address">
</cfcase>
<cfcase value="IPType">
WHERE
<cfif NOT IsDefined("URL.varoutput")
<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.RecordCou
<CFSET EndRow = QryGetColumnData.RecordCou
<CFSET Next = false>
<!--- Othereise, set Next to true and determine the next set of records. --->
<CFELSE>
<CFSET Next = true>
<CFIF EndRow + OnEachPage GT QryGetColumnData.RecordCou
<CFSET NextNum = QryGetColumnData.RecordCou
<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.R
<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=
}
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_pre
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&&p
d=parent.frames[n.substrin
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;
for(i=0;!x&&d.layers&&i<d.
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg
if ((x=MM_findObj(a[i]))!=nul
}
//-->
</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('
<table border="0" width="100%" cellspacing="0" cellpadding="0" background="img/bluespeck.
<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.jp
<tr>
<td height="29" background="img/backbar.jp
</tr>
<tr>
<td width="99%">
<p align="center">  
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="2%" background="img/sidebkg.jp
<td width="80%" valign="top">
<p style="margin-left: 20"> </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.recordCou
<cfoutput><span class="style16">No records were found for <span class="style19">#varoutput
<div align="center"><BR>
<span class="style18">Search Again?</span> [<a href="search.cfm">Yes</a>]
<cfelseif IsDefined("listVars") AND #QryGetColumnData.recordCo
<CFPARAM name="Lst_Columns" default="">
<CFPARAM name="Lst_Headings" default="">
<CFLOOP LIST="#listVars#" INDEX="Column_Index">
<CFSET Lst_Columns = ListAppend(Lst_Columns,Lis
<CFSET Lst_Headings = ListAppend(Lst_Headings,Li
</CFLOOP>
<div align="center">
<TABLE WIDTH="813" BORDER="0" align="center" bgcolor="#FFFFFF">
<TR>
<TD width="281"><span class="style11"><strong>Co
<CFLOOP list="#Lst_Headings#" index="Heading_Index">
<TD width="313" height="21"><div align="center" class="style10"><CFOUTPUT>
</TD>
</CFLOOP>
<TD width="205"><div align="center" class="style10">"Update/De
</TR>
</TABLE>
<BR><cfoutput>
<div align="center">(<span class="style20"><span class="style4"><span class="style21"><span class="style22"><strong>#Q
</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><fo
</div></TD>
</CFLOOP>
<TD width="454"><div align="center">
<a href="details.cfm?keyID=#Q
<a href="update.cfm?keyID=#Qr
<a href="delete.cfm?keyID=#Qr
</div></TD>
</TR>
</CFOUTPUT>
</TABLE>
</div>
</CFIF>
<div align="center">
<p> </p>
<TABLE BORDER = "0">
<TR>
<TD VALIGN = "top">
<!--- If Previous is true, display the previous link. --->
<CFIF Previous>
<CFOUTPUT>
<A HREF = "results.cfm?listVars=#lis
</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=#lis
</CFIF>
</CFOUTPUT>
</CFLOOP>
<TD VALIGN = "top">
<!--- If Next is true, display the previous link. --->
<CFIF Next>
<CFOUTPUT>
<A HREF = "results.cfm?listVars=#lis
</CFOUTPUT>
<CFELSE>
</CFIF>
</TD>
</TR>
</Table>
</p>
<p><a href="search.cfm">[New Search]</a></p>
<p> </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.recordCou
<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
</tr>
</table>
<table width="100%" height="54" border="0" cellpadding="0" cellspacing="0" bgcolor="#DCE7EF">
<cfif QryGetColumnData.recordCou
<tr>
<td width="100%" height="50"><p align="center" style="margin-left: 10"><font face="Arial" size="2">No Results! </font></td>
</tr>
<cfelse>
<tr>
<td width="100%" height="50"><p align="center" style="margin-left: 10"><font face="Arial" size="2"><CFOUTPUT>Records
</tr>
</cfif>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#7199BC"><div align="center">©2004 Adam Leszinski </div></td>
</tr>
</table>
<p> </p>
</body>
</html>
Thanks again!
B'regards
~trail
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-encr ypt',URLEN C)>
<CFDUMP VAR="#DECRYPTED#">
Try it out and show me the output. Cheers.
<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-
<CFDUMP VAR="#DECRYPTED#">
Try it out and show me the output. Cheers.
ASKER
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#&varou tput=#varo utput#&lis tCount=#li stCount#&s earchbutto n=#URLEnco dedFormat( searchbutt on)#"
<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#&Start Row=#PageN umStart#&P ageNum=#Th isPage#">
#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#&Start Row=#NextS tart#&Page Num=#Incre mentValue( 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=#URLEncodedFo rmat(searc hbutton)#
For use in the page
Out of the decrypted string.....
string = "listVars=#listVars#&varou tput=#varo utput#&lis tCount=#li stCount#&s earchbutto n=#URLEnco dedFormat( searchbutt on)#"
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
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#&varou
<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#&Start
#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#&Start
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=#URLEncodedFo
For use in the page
Out of the decrypted string.....
string = "listVars=#listVars#&varou
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
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)
ASKER
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#&varou tput=#varo utput#&lis tCount=#li stCount#&s earchbutto n=#URLEnco dedFormat( searchbutt on)#"
<cfset id = Encrypt(string,Key)>
Then my link looks like
<A HREF = "results.cfm?id=#id#&Start Row=#PageN umStart#&P ageNum=#Th isPage#"># 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!
Lets say if I use this:
<cfset Key = "1234567890">
<cfset string = "listVars=#listVars#&varou
<cfset id = Encrypt(string,Key)>
Then my link looks like
<A HREF = "results.cfm?id=#id#&Start
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!
ASKER
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
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
Sounds great. Good luck with your coding!
t
t
ASKER
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
Thanks again,
regards,
~trail