-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>        I have created a critical web based application which is not
>  allowed the user to press BACK and FORWARD button in order to 
> prevent 
> data integrity.
> 
> How do we disable the BACK button using CF, instead of using 
> Javascript history.back() ?
> 
> Another way is using session struct to record each template ID.
> 
> Can we implement more efficient way to do it?
> Thanks in advance.

The short answer is that you can't disable the back button and that
your code is flawed if it requires you to do so.

Basically, disabling or messing with basic browser functionality is a
dirty trick that ticks off most websurfers.  It's not something I'd
even think about doing.

If you still feel an overwhelming need to tick off your customers,
then have a look at:
http://www.4guysfromrolla.com/webtech/111500-1.shtml

Honestly, you'd be much better off altering your code so that it's
back button friendly.  You need to make sure that every page you
present to your user CAN be reloaded without causing any problems. 
The way to do that is to move any processing or data storage off the
pages you send to your users.  

Here's one way:
Say you have a series of steps the user has to go through.  Let's
call them Step1.cfm through Step12.cfm.  If you have Step1.cfm submit
to Step2.cfm, then there would have to be processing code in
Step2.cfm that could be messed up by hitting BACK.  

If you instead have Step1.cfm submit to Step1Proc.cfm, do all of your
processing, then CFLOCATION to Step2.cfm, then all of your processing
was handled off the page that the user can see.  At that point, your
user could sit and reload Step2.cfm all day without any problems.

If in addition to all of that, you make sure that any processing on
your Proc pages is reentrant (for lack of a better term), your users
could backup at any point with no problems.  By reentrant, I mean
that any actions you do should be able to be repeated without
problems.  Either update temporary DB entries or use Session
variables, then commit the whole mess at the end of the process. 
THEN if you make Steps 2 through 12 check to see if the temporary
table or sessions vars are present, you could even make those pages
say something like "Sorry, you can't come back," after the final
commit process is completed.

Hope that's helpful.

Best regards,
Zac Bedell


========================================
Zachary S. Bedell,
Chief Technology Officer,
Adirondack Technologies, Inc.

Please include original message in any replies -- I get a 
lot of email every day, and I have a REALLY bad memory... 
So I don't always remember everything that was said.  
Thanks!

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>

iQA/AwUBOhV4WavhLS1aWPxeEQJ6ugCgugTyoFomHWg/mLJ1kXoUWroyg3QAnjCe
4enup45j2Dqz6kZxe0zuJln2
=hPAu
-----END PGP SIGNATURE-----
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to