Re: Resolution detect and redirect

From: Date: Fri, 10 Aug 2001 14:04:23 +0000
Subject: Re: Resolution detect and redirect
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11222@lists.php.net to get a copy of this message
Does it work when Javascript is turned off in the client browser? Cara Lane - Designs In The Fast Lane wrote: > I have noticed many posting about this topic and the overall answer seems to > be it can't be done. Well, it can! > > I actually finally got it to work. It is actually quite simple. I think I > was trying to make it too hard. FYI, here is the code in case anyone else > has this problem: > This goes above <HEAD> on the page you need the php include code in. > <?php > if( !IsSet($w) ) > die('<html><head><script language="JavaScript" > > type="text/javascript">window.location.replace("http://www.theairwaysite.com > /restest.php?w=" + screen.width)</script></head></html>'); > ?> > This goes where the php include need to show on the page: > <?php > echo include('header'.$w.'.htm'); > ?> > Then you just have to name your headers for the resolution, ie > header800.htm, header1024.htm, etc... > Works like a dream! > It chooses a header based on the screen resolution of the user and includes > it in the proper place for the php include. > > Cara Lane > 214-868-9348 > www.designsinthefastlane.com > www.dallasbarterexchange.com

« previous php.db (#11222) next »