Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Getting around target=_blank...

...with my funky shopping cart script

2:11 am on Mar 13, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member mivox is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 6, 2000
votes: 0

Ok... my cookie-free shopping cart requires all pages to be loaded through a 'loadpage' script (ie- needs funky URLs for the links) in order to keep track of user shopping cart contents... and all 'funky URLs' must lead to pages within the store directory.

Currently, once you enter the 'store' on our site, any links to other areas open in a new window. Realizing this can be an annoyance to many users, I'm trying to decide how to get around it. I'm considering two options:

1. Make the shopping cart itself open in a smaller new window, so the main site is still loaded behind it. Doesn't really eliminate the problem, but I haven't noticed any user aversion to the 'pop-up' info windows I'm using in other areas...
Downside: Would need javascript to pop open the smaller shopping cart window, would still open a new window in the browser. Wouldn't be any advantage for users with small monitors.

2. Duplicate the rest of the site within the shopping cart directory, so once you enter the 'store' all the links to other areas would be in the 'special' format, and lead to the duplicated pages within the store directory.
Downside: Would nearly double the size of the site, and would be a major headache to make sure all links and references were changed properly.

I'm thinking I should buck up and go with #2, but I'm hoping someone may have an even better idea. Anyone?

2:24 am on Mar 13, 2001 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 25, 2000
votes: 0

I ran across this cool little script...maybe this will work for you. It redirects thru the script to a frame page with the top frame having the back to my site links:

This script entails two files: redirect.php, and top.php.
Here's the code for redirect.php:

# Redirect.php
# This script, when called, will look like:
# redirect.php?backtext=Back+To+My+World&backlink=http://www.myworld.com&linktitle=Microsoft+Website&url=http://www.microsoft.com
# All variables are optional, and you may set the default for left-out variables below.
if (!$sitetitle) {
if (!$url) {
if (!$backtext) {
$backtext="Go Back To Site";
if (!$backlink) {
if (!$linktitle) {
<HEAD><TITLE><? echo $sitetitle; ?> Link To: <? echo $linktitle; ?></TITLE></HEAD>
<FRAME SRC="top.php?backtext=<? echo $backtext; ?>&backlink=<? echo $backlink; ?>&url=<? echo $url ?>" NAME="LinksFrame" MARGINWIDTH=0 MARGINHEIGHT=0 scrolling=no noresize BORDERCOLOR="#FFFFFF">
<FRAME SRC="<? echo $url; ?>" NAME="AnswerFrame" BORDERCOLOR="#FFFFFF">
<p>Links Redirection works well only with frame-capable browsers.
Please upgrade your browser to take advantage of this script.
<P>Click on the link to proceed to <A HREF="<? echo $url; ?>" TARGET="_top"><? echo $linktitle; ?></A>

Here's The Code for top.php:

<SCRIPT Language="Javascript">
function RemoveFrames()
parent.location.href = parent.LinksFrame.document.forms[0].elements[0].value;
return false;

function OpenPopup(strFileName)

<!--javascript:top.location = parent.document.referrer;"-->
<TD NOWRAP><FONT FACE="Verdana" SIZE="1"><B> <b><a href="<? echo $backlink; ?>" target="_top"><? echo $backtext; ?></a> <A HREF="<? echo $url; ?>" target="_top">Remove Frame</A></b>
If you set all the variables in the script, then you can just link to script as: redirect.php?url=http://www.wherever.com

However, if you want to specify any or all of the variables on a link by link basis, then a link might look like: redirect.php?sitetitle=My+World+Inc.&backtext=Back+To+The+My+World+Website&backlink=http://www.myworld.com&linktitle=Microsoft+Website&url=http://www.microsoft.com

2:33 am on Mar 13, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member mivox is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 6, 2000
votes: 0

>It redirects thru the script to a frame page

Kinda like when you click an outgoing link on About.com? :)

If I could figure out how to work the framed redirects into the cart system, it might reduce 'new window' annoyance, but I think it would increase 'web novice' confusion.

Not to mention, about a month ago I went to the hassle of eliminating all the frames from our site... I'm still having to explain that decision to my boss every so often (he forgets why I did it on a regular basis). I'd like this change to be as 'transparent' as possible.

I'll keep that in mind though... I think having a 'return to the store' link would be less annoying than a whole new window.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members