PDA

View Full Version : Load correct Header.php


Anthony2oo4
05-14-2005, 12:45 PM
Hey guys. I was wondering if anyone can help me make a simple script?

Basicly I have this site called PlatinumHost.co.uk and after installing PHPNuke, I decided that it was too slow and is not really good for showing customers that my server is fast. So I made my own site with a little PHP (cause i have very little knowlege lol ) and mostly HTML. So far so good. Now the problem I am having is as follows:

Everything is set in tables, which have a width of 80% of the users screen. I have a logo, which I also want spread out over 80% of the users screen which I managed to do easily.

I came to a problem when I had to set a hotspot on my image to go to a different page, because it moved to different places obviousley because people have different screen resolutions. SEE BELOW:

<p align="center"><map name="FPMap0">
<area href="www.google.com" shape="rect" coords="179, 238, 217, 259">
<area href="http://www.google.com" shape="rect" coords="404, 238, 439, 258">
<area href="http://www.google.com" shape="rect" coords="626, 237, 662, 259">
</map>
<img border="0" src="http://platinumhost.co.uk/beta/images/logo.png" usemap="#FPMap0" width="80%" height="278"></p>

So then I decided that I would split the images up and do it that way, but again because of the different res, it looked screwed up.

You can see this here:
www.platinumhost.co.uk/beta/temp/cut1.htm

So i decided to make all the cut images to have a width of 100%, because they are set in a table to make them look correct, so I thought , once they hit rhe edge of the cell, it will stop and will look good. Which seemed to work, but every now and again, it screwed up.

See it here:
http://platinumhost.co.uk/beta/template.php

So I was wondering, Could someone help me write a small PHP script that works like this:

First page detects the users Screen res with this code:

<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==768) //if 1024x768
window.location.replace("http://www.dynamicdrive.com")

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

//-->
</script>

Then it redirects them to index2.php?(Screen res here)

then in index to it collects whatever screen res it was and loads the correct header for it. I have my logo set in a header.php file so i can make seperate header files which is no problem.

Then one last thing. Get it to store a cookie to remember what header to use every time they come to my site.

Sory for the big story but tried to explain the best I can.

Thanks for your time :thumbsup:

marek_mar
05-14-2005, 09:20 PM
Can't you just ask for good XHTML in the html forum?