www.uburst.com www.uburst.com

"Back to Referring Page - how?"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

Programmer Tips
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"Back to Referring Page - how?"
Posted by longtex on Aug-21-02 at 02:11 PM (EST)
We'd like to call the order completion pages from several sites, and at the bottom of the "thank you" page put a "return to..." link to send the user back whence he came without his having to hit the browser back button several times... I'm assuming that there's a mechanism in html and/or perl to catch the referring page address, and that the top page of ushop.pl or the first page that referes to it can store the return link...

Anyone?

Thanks - Butch

Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: Back to Referring Page - how?, Bill Weiner, Aug-22-02, (1)
RE: Back to Referring Page - how?, longtex, Aug-22-02, (2)
RE: Back to Referring Page - how?, Bill Weiner, Aug-23-02, (3)
RE: Back to Referring Page - how?, longtex, Aug-23-02, (4)
RE: Back to Referring Page - how?, Bill Weiner, Aug-26-02, (5)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: Back to Referring Page - how?"
Posted by Bill Weiner on Aug-22-02 at 04:44 AM (EST)
There are several ways to handle that... here's possibly the easiest:

STEP 1: Make a backup of your ushop.pl script... just in case.

STEP 2: Open your ushop.pl script with any text editor such as WordPad.

STEP 3: Do a search on the following line:

&display_order_form();

STEP 4: Immediately AFTER that line, add this line:

$extra_field1 = $ENV{'HTTP_REFERER'};

STEP 5: Now do a search on the following line:

$order_footer .= &substitute_key_fields($settings[71]);

STEP 6: Immediately AFTER that line, add this line:

$order_footer =~ s/USHOP_EXTRA1/$extra_field1/g;

STEP 7: Save the script... as TEXT... and try it out as per the additional information below.

The above modification will allow you to utilize the keyword "USHOP_EXTRA1" anywhere in the General Settings - Miscellaneous form's "Receipt Page Footer HTML" field ... and that "USHOP_EXTRA1" keyword will be replaced at runtime with the URL of the original referring page.

So in other words, you would now want to set the value of the "Receipt Page Footer HTML" field on the uShop Control Panel to something like this:

Return to < A HREF="USHOP_EXTRA1" > USHOP_EXTRA1

(And again, the USHOP_EXTRA1 keywords will be replaced at runtime with the referring URL.)

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "RE: Back to Referring Page - how?"
Posted by longtex on Aug-22-02 at 12:27 PM (EST)
Okay - it's =almost= working...

$extra_field1 = $ENV{'HTTP_REFERER'};

should be

$extra_field1 = $ENV{HTTP_REFERRER};

(or at least, perl complained until I changed it to that form).

Now, the problem is that this turns out to be (so far) the address of the cgi-bin directory, with no page name (e.g. https://secure.foobar.net/ushop/cgi-bin )
and this, of course, just gives you an access denied message.

What next, boss?

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
3 . "RE: Back to Referring Page - how?"
Posted by Bill Weiner on Aug-23-02 at 03:50 AM (EST)
I'm positive it should be:

$extra_field1 = $ENV{'HTTP_REFERER'};

(Yes, with single quotes and only one "R" in the middle. It's really cut-n-pasted from uShop's validate_referral_page() subroutine.)

... So what was the exact error message that you were getting from Perl? Perhaps you had a typo in there somewhere... so I would suggest trying that one more time.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
4 . "RE: Back to Referring Page - how?"
Posted by longtex on Aug-23-02 at 01:39 PM (EST)
LAST EDITED ON Aug-23-02 AT 01:51 PM (EST)

I had () as well as {} in it. Changing it back to one-R didn't make any difference, it's still empty.

I'm sure there's something elementary that I'm missing here.

Since I've got two servers, one "normal" and one "secure", I'm guessing that maybe the file locations are not set up completely correctly =- although the thing DOES run okay.

So... what goes on the "normal" server,and what goes on the "secure" server?

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
5 . "RE: Back to Referring Page - how?"
Posted by Bill Weiner on Aug-26-02 at 04:13 AM (EST)
I'm not sure what is going on with your server and the "HTTP_REFERER" environment variable, so here is another option where you can manually set the URL of the referring website.

Starting over from scratch....

ON THE JAVA SIDE....

STEP 1: On each website that the uShop Java Applets have been setup on, add the uShopInitialize applet to the same webpage that you have uShopOrderButton applet (typically the "Place Order" webpage of each site).

STEP 2: When adding the uShopInitialize applet to that "Place Order" page on each site, specify the "hidden_extra1" parameter as the URL of the webpage on that site to which you would like to link the customers back to... such as:

< PARAM NAME="hidden_extra1" VALUE="http://www.yourdomain.com" >

NOW, ON THE CGI SIDE....

STEP 3: Make a backup of your ushop.pl script... just in case.

STEP 4: Open your ushop.pl script with any text editor such as WordPad.

STEP 5: Now do a search on the following line:

$order_footer .= &substitute_key_fields($settings[71]);

STEP 6: Immediately AFTER that line, add this line:

$order_footer =~ s/USHOP_EXTRA1/$hidden_extra1/g;

(NOTE: Unlike the previous instructions that I gave you, note how now the "$hidden_extra1" field is used.)

STEP 7: Save the script... as TEXT... and try it out as per the additional instructions below.

The above modification will allow you to utilize the keyword "USHOP_EXTRA1" anywhere in the General
Settings - Miscellaneous form's "Receipt Page Footer HTML" field ... and that "USHOP_EXTRA1" keyword will be replaced at runtime with the value from the "hidden_extra1" parameter of your uShopInitialize applet.

So in other words, you would now want to set the value of the "Receipt Page Footer HTML" field on the uShop Control Panel to something like this:

Return to < A HREF="USHOP_EXTRA1" > USHOP_EXTRA1 < /A >

(And again, the USHOP_EXTRA1 keywords will be replaced at runtime with the value of the "hidden_extra1" parameter.)

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.