HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 16th, 2000, 04:53 PM
Stephane moureau Stephane moureau is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Blaton, Ht, Belgium
Posts: 1 Stephane moureau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
___ FLU();

Can you help on this routine ? (flu) is used to force all visitors to
go first on the home page http://home.freegates.be/club-bourse/ if
they arrived on another page first (from a search engine).

Because all visitors must click on the links to US/FR/NL pages.
This link launches this /cgi-bing/go.pl?fr (or ?us or ?nl). This perl
is used to collect various files for the moment (automatic download of
files).

How does it works ?
Every page display a banner on top of the page. The code is in JS.
Just before displaying the banner, flu() is launched to check if the
visitor has visited the home page.
On the home page a cookie is added, just to know if he has visited it,
nothing else.

But as you can see, http://home.freegates.be/club-bourse/ is
immediately modified to http://home2.freegates.be/club-bourse/ (2 is added).

I have modified the code but it does not work on MS browserS.

On NETSCAPE the navigator.CB is used and it works perfectly.
As you can see in flu(), the MS part (after 1st ELSE) is not working.

Note:
Don't confuse, for Netscape navigator.CB is set to the String "Stf"
but in MS part of the code
Stf is a VAR equal to http://home.freegates.be/club-bourse/ and Stf2
for the second URL.
They are not related and this was done intentionaly to make the code
more unreadable to newbies.

CAN YOU HELP ?
Create a more reliable FLU() function that works for Netscape
(navigator.CB var exists only in Netscape) and for MS Browsers (and
others ?). The more browsers you can handle the more powerful will
become our go.pl routine for SRS.

If you have any other solution (not in java!) to force user to go on
the home page when they enter a CB page, don't hesitate.

Thanks in advance.

Please also send your answers to thx1133 -AT- freegates.be

Sincerely
Stf

CODE INSIDE THE HOME PAGE
...
<SCRIPT language=javascript>
<!--
document.cookie = "Club-Bourse=Welcome;";
if (navigator.appName.substring(0,8) == "Netscape") navigator.CB =
"Stf";
// -->
</SCRIPT>
<NOSCRIPT><P>This site requires javascript!</P></NOSCRIPT>
...

CODE INSIDE AN EXTERNAL cb01.js include file
THIS CODE IS CALLED FROM ALL CB PAGES BY THE FOLLOWING LINES :
...
</HEAD>
<BODY bgcolor=#ffcc33 text=#000000 link=#663333 vlink=#000000
alink=#666666>
<SCRIPT src=../cb01.js language=JavaScript1.1></SCRIPT>
<SCRIPT>
<!--
document.write (lebanner());
// -->
</SCRIPT>


PART OF THE cb01.js file
...
function lebanner()
{
flu();
var lk = 1 + Math.round(180 * Math.random());
return('<center><iframe src="http://leader.linkexchange.com/' + lk +
'/X529994/showiframe?" width=468 height=60 marginwidth=0
marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no><a
href="http://leader.linkexchange.com/' + lk + '/X529994/clickle"
target="_top"><img width=468 height=60 border=0 ismap alt=""
src="http://leader.linkexchange.com/' + lk +
'/X529994/showle?"></a></iframe><br><a
href="http://leader.linkexchange.com/' + lk + '/X529994/clicklogo"
target="_top"><img src="http://leader.linkexchange.com/' + lk +
'/X529994/showlogo?" width=468 height=16 border=0 ismap
alt=""></a><br></center><P>');
}

function flu()
{
if (top.location.href.substring(0,10) == "file:///D1") return;
var Stf = "http://home.freegates.be/club-bourse/";
var Stf2 = "http://home2.freegates.be/club-bourse/";

if (navigator.appName.substring(0,8) == "Netscape")
{
if (navigator.CB != "Stf") top.location.href = Stf;
}
else
{
if (!document.cookie) top.location.href = Stf2 ;
else
{
if ((document.referrer.substring(0,37) != Stf) &&
(document.referrer.substring(0,38) != Stf2)) top.location.href = Stf;
else
if (top.location == this.location) top.location.href =
Stf2;
}
}
}

------------------
http://home.freegates.be/club-bourse/

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Help force visitors to visit Home Page ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway