GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 22-Oct-2003, 10:49
rhino1616 rhino1616 is offline
Junior Member
 
Join Date: Apr 2003
Posts: 46
rhino1616 is on a distinguished road

How do web redirection scripts work?


Good Morning, I'm a big rookie web designer and I created my website for 3 different sizes/resolutions (640x480, 800x600, 1024-76. I found all these web redirect scripts on the web, that redirect the user to the right size/rez for thier montior but Im a bit confused. Does this mean I have to register 3 individual web domain names for these scripts to work? I have one http://www.myname.com site registered already, and I wouldnt want to purchase/register a bunch of others, I thought the redirect script could work with 1 domain name, or am I wrong? Does someone know how these types of scripts work?

Thank you for your time.
  #2  
Old 22-Oct-2003, 11:02
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
To quickly answer your first question: No, you do NOT need 3 different domain names!

How do re-direct scripts work? That depends on what you're trying to do... For a user based width setting for your layout, I would assume you are planning to set a cookie, get JavaScript to figure out the screen width, set the value in a cookie then 'refresh' the current page to read the cookie value already set for the user's screen width?
  #3  
Old 23-Oct-2003, 09:27
rhino1616 rhino1616 is offline
Junior Member
 
Join Date: Apr 2003
Posts: 46
rhino1616 is on a distinguished road
Thanks for the info JdS
  #4  
Old 23-Oct-2003, 16:09
rhino1616 rhino1616 is offline
Junior Member
 
Join Date: Apr 2003
Posts: 46
rhino1616 is on a distinguished road
Hi JDS. I went ahead and tried the redirect script and maybe you can shed some light on this. I added the redirect script and kinda work, what I mean is that it does redirect the page, unfortunately I designed my website in frames. My webpage has 3 frames a banner, middle/body, and a footer. I added the script to the middle frame because I cant & dont know where to add the script in the index page of a framed website, or if you can even add the script to the index page of a frames website. The script I added looks like this:

<script language="JavaScript1.2">
<!--

if (screen.width==800||screen.height==600) //if 800x600
window.location.replace("http://uniteddistributorscanada.hypermart.net/")

else if (screen.width==640||screen.height==480) //if 640x480
window.location.replace("http://uniteddistributorscanada.hypermart.net/")

else if (screen.width==1024||screen.height==76 //if 1024x768
window.location.replace("http://uniteddistributorscanada.hypermart.net/1024x768")

else //if all else
window.location.replace("http://uniteddistributorscanada.hypermart.net/1024x768")

//-->
</script>

If you go to the website you'll notice depending on the resolution that you have the entire new page is redirected into the main body of the framed site (where I added the script). Is there any way to fix this, and have the whole page redirect. You can view the website at: http://uniteddistributorscanada.hypermart.net/

Thanks again

PS: heads up on the pop ups
  #5  
Old 23-Oct-2003, 16:52
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
I believe you have to add it in the index page. Put it inside the <head></head> tag.
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business.
  #6  
Old 23-Oct-2003, 16:56
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
I would suggest you dith the frames...

Frame sites do not look that great at all. It especially stinks when you want to be indexed by a search engine.
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business.
  #7  
Old 24-Oct-2003, 12:54
rhino1616 rhino1616 is offline
Junior Member
 
Join Date: Apr 2003
Posts: 46
rhino1616 is on a distinguished road
Hi, and thanks for the info guys. Believe me, I realized later that I should have designed it in frames. I did what you said and found the index.htm and added a script I found on the net to my frames website, and the free script looks like this:

<script language="JavaScript1.2">
<!--

/*
Screen Size Redirect script (By Robert @ http://members.tripod.com/technological_tinker/)
Submitted to Dynamicdrive.com to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/


if (screen.width==800||screen.height==600) //if 800x600
window.location.replace("http://www.netscape.com")

else if (screen.width==640||screen.height==480) //if 640x480
window.location.replace("http://www.microsoft.com")

else if (screen.width==1024||screen.height==76 //if 1024x768
window.location.replace("http://www.dynamicdrive.com")

else //if all else
window.location.replace("http://freewarejava.com")

//-->
</script>


So I just altered the script and added the urls to it, and this is what it looks like in my index page:


<script language="JavaScript1.2">
<!--

/*
Screen Size Redirect script (By Robert @ http://members.tripod.com/technological_tinker/)
Submitted to Dynamicdrive.com to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/


if (screen.width==800||screen.height==600) //if 800x600
window.location.replace("http://www.uniteddistributors.ca")

else if (screen.width==640||screen.height==480) //if 640x480
window.location.replace("http://www.uniteddistributors.ca")

else if (screen.width==1024||screen.height==76 //if 1024x768
window.location.replace("http://www.uniteddistributors.ca/1024x768/")

else //if all else
window.location.replace("http://www.uniteddistributors.ca/1024x768/")

//-->
</script>


I added to the frames index.htm page & tested it out, and it seemed to work perfectly. I did a few other touch ups and uploaded it & when I viewed it, it didnt redirect. If your rez is at 800x600 and you visit the site at: http://www.uniteddistributors.ca/ it looks alright, but if your rez is 1024x768 it wont redirect to the 1024x768. I tested it out to see if the pages are on the web by typing the url directly and its there: http://www.uniteddistributors.ca/1024x768/
Do you know, whats wrong? I have a funny feeling its something very simple. If there's any help you can give I'd appreciate it.

Thank you
  #8  
Old 24-Oct-2003, 15:49
rhino1616 rhino1616 is offline
Junior Member
 
Join Date: Apr 2003
Posts: 46
rhino1616 is on a distinguished road
Hi guys, I finally got it working correctly. Thank you very much for the help


Rhino1616
  #9  
Old 25-Oct-2003, 08:01
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Sorry rhino, everyone who is a regular here knows that my JavaScript knowledge is simply 0.... but I am GLAD you got it working finally.

Care to explain what the fix was? If we're lucky this thread may get a few more views off the Search Engines for the issue. It will help others if this thread ended in a workable solution.
  #10  
Old 27-Oct-2003, 09:47
rhino1616 rhino1616 is offline
Junior Member
 
Join Date: Apr 2003
Posts: 46
rhino1616 is on a distinguished road
Hi JDS, actually it wasnt anything major it was a typo & placement error on my part. I had typed the wrong url to redirect to, and the second error is that I uploaded 2 index pages to the web which in turn confused the Javascript that was inserted into my homepage. Sometimes its the simple things that can coinfuse us the most.

Thanks again JDs
 

Recent GIDBlogFirst week of IA training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
probelm with apache redirection configure pelegk2 Apache Web Server Forum 2 14-Dec-2003 04:18
Why doesnt my form work correctly? rhino1616 Web Design Forum 2 06-Nov-2003 17:21
Another excuse not to go to work? Garth Farley Open Discussion Forum 1 19-May-2003 15:52
Why doesnt my autorun CD work on other computers? rhino1616 Computer Software Forum - Windows 3 01-May-2003 18:23
I have 3 cgi scripts working in Tripod Guest Free Web Hosting 0 11-Jul-2002 14:07

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:57.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.