Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variable and changing location

Status
Not open for further replies.

Idee

Programmer
Jul 8, 2003
51
0
0
NZ
Hi everyone,

I want to click on a link and pass some values and when that page is displayed, the address bar should not display the actual location of the file. Moreover I don't want to pass variables using url.

What i thought was that some function will be called whether hyperlink is clicked or a button is submitted and depending upon the values passed, either the corresponding file is directed using <cflocation> or file can be included.

But how to actually implement it.., no idea. I tried to use <cflocation in javascript but didn't work..

<script language=&quot;javascript&quot;>
function change(id){
<cfif id NEQ &quot;&quot;>
<cflocation url=&quot;test.cfm&quot;>
</cfif>
}
</script>

This function is called on clicking the href, it entered the function and was displaying the correct value of id but didn't do anything.

Any suggestions are welcome.

Thanks
 
You could submit a form by clicking a link i guess.
Just give your form the method=&quot;post&quot; attribute.

<form name=&quot;MyForm&quot; method=&quot;post&quot; action=&quot;actionpage.cfm&quot;>
<a href=&quot;javascript:document.MyForm.submit();&quot;>some text</a>
</form>
 
no offence, but might this be another example of trying to solve the wrong problem -- see
the main problem i see is that you don't want the address bar to show the location

solution: go ahead and show the location, i.e. the specific url, using a scheme that is next-to-impossible to break -- random identifiers

if there are very many of these files, you will probably be using a database, in which case generating random identifiers is easy

if there are only a few files, you can maintain a list of random identifiers in coldfusion in several ways

when people see the following url, what do they learn from it?


what possible way do they have of getting anything other than that file?

okay, yes, people can guess

but suppose i told you that there are only a hundred identifiers available?

how long would it take you to guess one of them?


rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top