Click to See Complete Forum and Search --> : Refered Page problem


LampStone
09-08-2003, 01:05 PM
Hello, this is my first post. I am very new to js and I have a problem.
I used a free referred page script in a FP web page thinking it would prevent people from accessing a quiz without paying for it. Well it didn't work the way I intended to so I deleted the code and tried a different route. This route worked on two of my pages, but on the third one - the old js is still there and I cannot find it for the life of me. (Well, I found where it is located - in a temp internet file - but I cannot get to it.
Here is the origianal script:
<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var requiredfrom = "index.html"; // required prev. page
if (document.referrer.indexOf(requiredfrom) == -1) {
alert("You must come to this page from " + requiredfrom);
window.location=requiredfrom;
}
// End -->
</script>

And here is my revised script for my page:

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var requiredfrom = "https://www.paypal.com/"; // required prev. page
if (document.referrer.indexOf(requiredfrom) == -1) {
alert("You must come to this page from " + requiredfrom);
window.location=requiredfrom;
}
// End -->
</script>

I realized after I did this that it wouldn't work - because it is coming from the "confirmation" page link I set up WITHIN paypal button creator - and so - I don't have the right 'requiredfrom' page - since it is secure! So -

now I am stuck with this "loop" and can't figure out how to get rid of it.
Thanks for helping me.
(And I was just starting to like js!)
Regards,
LampStone

BestZest
09-08-2003, 01:25 PM
If you cahnge the requiredfrom to just 'paypal' then it will work, but people can come from anywhere in the paypal site.
Are you sure people don't come from the same link, or a link with similar characteristics every time after they've payed? Let me know.

BestZest

LampStone
09-08-2003, 02:29 PM
Yes - they always come from a the paypal site...but after you pay and get a confirm page from PayPal - there is a "click here to continue" button that one can configure to go to their own website address - or leave it to return to PayPal for more shopping. So . I set up that link to go back to my page...BUT - when you go through the process you get an error saying something like "You have to come to this page from www.paypal.com and it takes you right back to a paypal default signin page. Here is the code from button generated from paypal:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="image" src="https://www.paypal.com/images/x-click-but23.gif" border="0" name="submit" alt="Make

payments with PayPal - it's fast, free and secure!" width="68" height="23">
</p>
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="nbs@nationalboardspecialists.com">
<input type="hidden" name="item_name" value="Spinal Anatomy Online Quiz">
<input type="hidden" name="amount" value="5.00">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://www.yoursite.com/">
<input type="hidden" name="cn" value="Your comments are welcome!">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
</form>

Does that help?
Thanks.
Pam