Shoutbox

forward browser script - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: forward browser script (/showthread.php?tid=59326)

forward browser script by DJKAL on 05-12-2006 at 10:37 PM

i am starting a website for my cousin tonight and i have a logo wich i want to have transparency - no problem. though in IE it doesnt view properly - problem solved, i matched the gradient and it is ok. though in firefox it isnt

can someone please give me a script to make the browser forward the page viwer to a differnet page if they are viewing in firefox as aposed to those viewing in IE

can someone please help, this is not for me - it is for my cousin and all women out there


RE: forward browser script by rav0 on 05-12-2006 at 11:39 PM

I'd use a ready-made server side script to detect Internet Explorer (find one), then serve the same page, with just the different logo served for Internet Explorer.

There are also JavaScript scripts which can have Internet Explorer display alpha-channel PNGs correctly, which might be better.

I can help you more if you want.


RE: forward browser script by DJKAL on 05-12-2006 at 11:44 PM

thanks, i was thinkin of using JavaScriptbut not sure of the code.
the site (at the moment - i have bought her a domain and once set up on my hosting will be changed) is www.calumsdiscos.co.uk/shiv
in internet explorer it displays perfectly but firefox shows the colours differently. i can use transparency to solve that but need a way to get the website to detect firefox then forward the user to a similar version of the website though different images (such as: www.firefox. (her domain here).co.uk ) but i need a way to detect firefox and forward it to that link


RE: forward browser script by Plik on 05-13-2006 at 12:28 AM

IIRC, IE renders the colours of a png slightly differently to everything else (god knows why, perhaps something todo with ignore alpha channel data).

So, you have two options, either stop using png, and use a different format, or use some php code to detect the browser (using the useragent) and display a different image depending on what the browser is.
Don't build two different sites, just have two versions of the image, and simply output different html.
Google for "php browser detect" or something along those lines for some code :P


RE: forward browser script by rav0 on 05-13-2006 at 12:52 AM

Ummm ... what was wrong with just using text? Does it really need to be in a image?

PNG in Windows IE is the website which explains the PNG problem and has the workaround script, with good instruction on how to use it. It makes PNGs with alpha channel work properly in Internet Explorer versions 5 and 6. It will let you use the image that you were first using, and have it work properly in most browsers. I'd use this method. I can help you put it into the website.

If you want to use different images, then you should give special images to Internet Explorer versions 5 and 6 only, because they have the problem. Give Firefox and other browser normal images (with transparency). I can make a script for this if you want.


RE: forward browser script by ShawnZ on 05-13-2006 at 03:51 AM

make sure you choose "save gamma" when saving the png


RE: forward browser script by DJKAL on 05-13-2006 at 05:48 AM

quote:
Originally posted by rav0
I can make a script for this if you want.

if you would i would be real greatfull and my cousin will be too.

quote:
Originally posted by rav0

Ummm ... what was wrong with just using text? Does it really need to be in a image?

it was not my choice - my cousin wanted it like that, that's just for the first page where you click "enter" to get into the site so in the site i will use text and not all the images, but none of this is my choice - all hers.
RE: forward browser script by segosa on 05-13-2006 at 06:04 AM

Tell her that when people visit webpages they actually expect to see a website, not an entry page causing them to have to click somewhere again before they can even get to where they were going.


RE: forward browser script by DJKAL on 05-13-2006 at 06:07 AM

i know this, and did mention it to her but a lot of other sites have it and sh is just etting it to a style she likes and that will attract the other women (to her website not to her ...)
and though this page can be annoying on times it creats an ammediate  impact and i am just creating what she wants


RE: forward browser script by Chestah on 05-13-2006 at 06:57 AM

quote:
Originally posted by segosa
Tell her that when people visit webpages they actually expect to see a website, not an entry page causing them to have to click somewhere again before they can even get to where they were going.

Sadly not everyone thinks that way seg. Personally my favourite is when you click a link and then you get redirected to an advertisement page before the actual page you want to see :).
RE: forward browser script by rav0 on 05-13-2006 at 07:32 AM

This goes anywhere at the top of the page, just once, as long as it's before you use the next bit:

code:
<?php
$ua=$_SERVER['HTTP_USER_AGENT'];
if(strstr($ua,'MSIE 2') OR strstr($ua,'MSIE 3') OR strstr($ua,'MSIE 4') OR strstr($ua,'MSIE 5') OR strstr($ua,'MSIE 6')) {
    $badie=TRUE;
}
else {
    $badie=FALSE;
}
?>
This bit goes any place that you want different code for Internet Explorer, as many times as you like:
code:
<?php
if($badie==FALSE) {
?>
<!-- normal html here -->
<?php
}
else {
?>
<!-- special html for IE here -->
<?php
}
?>
I still think that you should the original, transparent image all the time, and use the JavaScript fix to have it work properly in Internet Explorer (even Microsoft does it this way).
RE: forward browser script by DJKAL on 05-13-2006 at 07:34 AM

quote:
Originally posted by rav0
use the JavaScript fix to have it work properly in Internet Explorer (even Microsoft does it this way).

what fix is this?

also: i have now saved the images as .gif and used them and the transparency shows fine.
RE: RE: forward browser script by rav0 on 05-13-2006 at 07:57 AM

quote:
Originally posted by rav0
PNG in Windows IE is the website which explains the PNG problem and has the workaround script, with good instruction on how to use it. It makes PNGs with alpha channel work properly in Internet Explorer versions 5 and 6. It will let you use the image that you were first using, and have it work properly in most browsers. I'd use this method. I can help you put it into the website.

RE: forward browser script by absorbation on 05-13-2006 at 10:29 AM

rav0 code should work, but if it is only an image, here is a simpler way to do it: :P

code:
<?PHP
$browser= $_SERVER['HTTP_USER_AGENT'];

if(strstr($browser,'MSIE 2') OR strstr($browser,'MSIE 3') OR strstr($browser,'MSIE 4') OR strstr($browser,'MSIE 5') OR strstr($browser,'MSIE 6')) {
$showimage= "<img src=\"/images/ie-image.gif\" />";
}

else {
$showimage= "<img src=\"/images/normal-image.gif\" />";
}

echo $showimage;
?>

Just put that where you want the image to show. Change the image links of course, but leave the backshlashes (\\\\\) as it is important for the syantax. ;)
RE: forward browser script by DJKAL on 05-13-2006 at 10:40 AM

if i need to use PNG (as i am now using .gif instead) i will try the JAVA script - if it doesn't work then i will use the PHP method
thanks to all of you :)

oh - and if you're interested - the new doman is: www.survivors-haven.co.uk


RE: forward browser script by absorbation on 05-13-2006 at 10:41 AM

quote:
Originally posted by DJKAL
if i need to use PNG (as i am now using .gif instead) i will try the JAVA script - if it doesn't work then i will use the PHP method
thanks to all of you

I suggest PHP, some browsers dont allow javascript. ;)
PHP is to do with your server and works the same on every browser :)
RE: forward browser script by DJKAL on 05-13-2006 at 10:43 AM

ok thanks. can i stil the save the page as .htm?


RE: forward browser script by absorbation on 05-13-2006 at 10:45 AM

quote:
Originally posted by DJKAL
ok thanks. can i stil the save the page as .htm?

nope, has to be php. :P
But you may as well use it as an extension because php can make coding new pages so much easier. :)
RE: forward browser script by DJKAL on 05-13-2006 at 10:47 AM

ok.
so "index.php" ?
and i cant code PHP only XHTML, CSS and JavaScript


RE: forward browser script by absorbation on 05-13-2006 at 10:48 AM

quote:
Originally posted by DJKAL
and i cant code PHP only XHTML, CSS and JavaScript

You soon will learn. :)

quote:
Originally posted by DJKAL
so "index.php" ?

yep, instead of index.htm.
RE: forward browser script by DJKAL on 05-13-2006 at 10:52 AM

quote:
Originally posted by absorbation
You soon will learn.
hope so :D after my exams i want to try and learn the basics then progress :)

thanks for al your help
RE: RE: forward browser script by rav0 on 05-13-2006 at 12:53 PM

quote:
Originally posted by DJKAL
i am now using .gif instead
FYI, PNGs work fine in Internet Explorer, but alpha channel doesn't, so if you'r going to have it as a GIF (which can't have alphe channel), you can save a PNG without alpha channel, have it work perfectly, have gamma correction, and have a smaller filesize.
quote:
Originally posted by DJKAL
JAVA script
JavaScript not JAVA script ;).
RE: forward browser script by DJKAL on 05-13-2006 at 01:02 PM

i cant find those settings when looking.
but it's ok now i can use the Javascript (which is what i usualy type didnt type it right early - accident :$) or the PHP thanks to you all :)