> So this install page performs a task that I don't want people > to be able to hit the back button and perform the task twice. > > ... > > Any thoughts or suggestions would be great. > > ... > > <script language="JavaScript" > > > function checkInstalled(){ > > if(factory.printing != null){ > > > factory.printing.PrintHTML("global_files/displaycoupon.cfm?ID= " + <CFOUTPUT>#ID#</CFOUTPUT>); > alert("The coupon has been sent to your printer. > Please note the expiration date on the printed coupon."); > document.location.href="http://www.homepage.com"; > } else { > setTimeout('checkInstalled()', 1000); > } > } > </script>
I think that, if your goal is to prevent people from printing out a coupon multiple times, don't put it on a web server. This would be very easy to circumvent no matter what you do, with CF or JavaScript. For example, a user could simply set his default printer to PDF, like mine already is. That said, I can think of a couple of measures you could use. First, you could include a barcode in your coupon, and provide information within the barcode to prevent reuse of multiple printings. This is how online tickets are handled; Ticketmaster is one example. Second, you could present the ticket in a separate window, opened through JavaScript; this window could present no browser controls, and could close when complete. This would make it more difficult (though not impossible) to reprint the coupon. Within the opening page, you could determine whether the child window has been opened once already, to prevent it from being reopened. Of course, this approach requires the use of a popup window, so it may be defeated by aggressive popup blockers. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287384 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4