Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista wifi windows windows vista windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Tricking the Back Button?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
DKLA's Avatar
Member with 30 posts.
 
Join Date: Sep 2007
Experience: Intermediate
29-Oct-2007, 04:00 PM #1
Tricking the Back Button?
I have a product that is setup through a third party shopping cart. When a customer orders the product it goes to a thank you page that we have made on our server (pretty basic "thanks for your order....check your email for confirmation...blah blah). This page also has a pixel on it (tracker) for our affiliates who are marketing it.

Problem: If a customer for any reason trys to go back (using regular back button) it cannot get back into shopping cart (because its secured) and reloads page (meaning the pixel will also shoot off again). This will mess up our data on conversion with our affiliates.

Question: Is there any javascript coding i can do that will make the default back button jump 2 pages instead of 1?

If not... Is there any way to disable the regular back button so that i can put a customized on there?
Fyzbo's Avatar
Senior Member with 1,777 posts.
 
Join Date: Feb 2002
Location: North Carolina, USA
Experience: Programming-Advanced|EVER
29-Oct-2007, 04:05 PM #2
Seems that there is a redirect taking place which is repeated when the user hits the back button. I don't know of any code which can stop or trick the back button. I would suggest trying to find a way to remove the redirect so the back button works properly. Alternatively, figure out why the user wants to go back, and provide those options as links on the "Thank you" Page, then they will have no need to go back.
DKLA's Avatar
Member with 30 posts.
 
Join Date: Sep 2007
Experience: Intermediate
29-Oct-2007, 04:29 PM #3
since i can't customize the redirect (third party shopping cart)... can i possibly send it to my own page that has a automatic redirect and then to the thank you page (but have it pop up or code it to not have a address bar or buttons - like a pop up would)?

Can a redirect make a pop up?
DKLA's Avatar
Member with 30 posts.
 
Join Date: Sep 2007
Experience: Intermediate
29-Oct-2007, 04:34 PM #4
also....

my affiliates sent me this link http://www.javascriptkit.com/script/...isplayip.shtml which might help to just catch the IP addresses.... great idea but do I need to do anything to this code before I copy paste? (Like put in my page address anywhere)?
Fyzbo's Avatar
Senior Member with 1,777 posts.
 
Join Date: Feb 2002
Location: North Carolina, USA
Experience: Programming-Advanced|EVER
29-Oct-2007, 04:48 PM #5
I am at a loss for your first problem, perhaps someone smarter here can help.

As for the ip address it looks like you can copy and paste given your hosting support SSI. If not there are many solutions to obtaining a users IP address. What are you trying to accomplish with this script?
DKLA's Avatar
Member with 30 posts.
 
Join Date: Sep 2007
Experience: Intermediate
29-Oct-2007, 04:56 PM #6
i want to identify my customers as one and not 3 (because of them pressing back). If the pixel keeps shooting off...we wont know how many people really ended up ordering.
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,705 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
29-Oct-2007, 05:26 PM #7
I've got an idea. What if you increment the "order counter" when the submit button is clicked? First, when your "thank you" page is loaded, does the shopping cart loads the "thank you" page, does it pass additional information to the page? For example, when I buy something, does the "thank you" page get loaded with a URL like this:

http://www.site.com/thankyou.html

or like this:

http://www.site.com/thankyou.html?[something]=[something]

If it's the latter, then the "thank you" page can contain JavaScript to increment the counter. This JavaScript could interrogate the URL used to load the "thank you" page for some kind of indicator that an order was placed.

Or maybe, you could have an "onSubmit()" function bound to the submit button. That way, when they click submit (to place the order), the onSubmit() function is called which will be JavaScript that will increment the counter. This JavaScript code could load the "counter image" in a popup that disappears or something else.

Depending on how the "thank you" page gets loaded, you might be able to give it enough intelligence to count the customer in a more reliable fashion.

Peace...
DKLA's Avatar
Member with 30 posts.
 
Join Date: Sep 2007
Experience: Intermediate
29-Oct-2007, 05:30 PM #8
well it comes up as the first....just my regular page link...no latter
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,705 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
29-Oct-2007, 07:22 PM #9
Ok, if you're sure the shopping cart doesn't send any parameters to the thank you page, then you'll have to bind to the "submit" button using "onSubmit". That way, you "count" each time someone clicks the submit button on the checkout page. You can read about onSubmit here, among other places.

Basically, I'm thinking you code some JavaScript to load the "counter" image. Then, in the form in the shopping cart (where the action is specified), you add the "onsubmit" code and the counter should increment each time the checkout button is clicked.

Peace...
rickfisher's Avatar
Computer Specs
Member with 34 posts.
 
Join Date: Nov 2007
Experience: Beginner
04-Nov-2007, 05:26 PM #10
Tracker
Is your tracker similar to a counter, that you can set it up to only count each person once by their IP address?
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,192 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
04-Nov-2007, 05:42 PM #11
Put a notice on your site that instead of using the back button, click "this link"

And use this for the link:

<a href="#" onClick="history.go(-2)">This Link</a>

The -2 means it will go back 2 pages in the browser history, instead of the usual 1 that the back button does.

But this, of course, will only work if the user have JavaScript enabled in their browser. Since it's a client-side scripting language, it can easily be turned off by the user.
__________________
-----------------------------
| 404: Name Not Found |
-----------------------------
PLEASE NOTE: If I happen to help you in a post, or just simply reply to it, doesn't mean I want to be bombarded with PMs. I answer all questions in posts, not in PMs. Thank you, and have a good day.

<?php $h = 'Hello '; $w = 'World'; echo $h.$w; ?>

My Favorite Editors:
Windows: Crimson Editor
Mac: Taco HTML Edit
Linux: gPHPEdit
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:53 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.