forward browser script |
Author: |
Message: |
rav0
Veteran Member
    

i have an avatar
Posts: 1418 Reputation: 29
35 / / 
Joined: Aug 2003
|
RE: forward browser script
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).
| ![[Image: dorsh]](http://tinyurl.com/dorsh) |
(\ /)
(O.o)
(> <)
This is Bunny. Copy Bunny into your signature to help him on his way to world domination
|
|
05-13-2006 07:32 AM |
|
 |
DJKAL
Senior Member
   

Posts: 800 Reputation: 14
34 / / –
Joined: Oct 2005
|
O.P. RE: forward browser script
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.
"You don't sleep, you defragment!"
|
|
05-13-2006 07:34 AM |
|
 |
rav0
Veteran Member
    

i have an avatar
Posts: 1418 Reputation: 29
35 / / 
Joined: Aug 2003
|
RE: RE: forward browser script
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.
| ![[Image: dorsh]](http://tinyurl.com/dorsh) |
(\ /)
(O.o)
(> <)
This is Bunny. Copy Bunny into your signature to help him on his way to world domination
|
|
05-13-2006 07:57 AM |
|
 |
absorbation
Elite Member
    

Posts: 3636 Reputation: 81
– / / 
Joined: Feb 2005
|
RE: forward browser script
rav0 code should work, but if it is only an image, here is a simpler way to do it:
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. 
|
|
05-13-2006 10:29 AM |
|
 |
DJKAL
Senior Member
   

Posts: 800 Reputation: 14
34 / / –
Joined: Oct 2005
|
O.P. RE: forward browser script
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
"You don't sleep, you defragment!"
|
|
05-13-2006 10:40 AM |
|
 |
absorbation
Elite Member
    

Posts: 3636 Reputation: 81
– / / 
Joined: Feb 2005
|
RE: forward browser script
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 
|
|
05-13-2006 10:41 AM |
|
 |
DJKAL
Senior Member
   

Posts: 800 Reputation: 14
34 / / –
Joined: Oct 2005
|
O.P. RE: forward browser script
ok thanks. can i stil the save the page as .htm?
"You don't sleep, you defragment!"
|
|
05-13-2006 10:43 AM |
|
 |
absorbation
Elite Member
    

Posts: 3636 Reputation: 81
– / / 
Joined: Feb 2005
|
RE: forward browser script
quote: Originally posted by DJKAL
ok thanks. can i stil the save the page as .htm?
nope, has to be php. 
But you may as well use it as an extension because php can make coding new pages so much easier. 
|
|
05-13-2006 10:45 AM |
|
 |
DJKAL
Senior Member
   

Posts: 800 Reputation: 14
34 / / –
Joined: Oct 2005
|
O.P. RE: forward browser script
ok.
so "index.php" ?
and i cant code PHP only XHTML, CSS and JavaScript
This post was edited on 05-13-2006 at 10:47 AM by DJKAL.
"You don't sleep, you defragment!"
|
|
05-13-2006 10:47 AM |
|
 |
absorbation
Elite Member
    

Posts: 3636 Reputation: 81
– / / 
Joined: Feb 2005
|
RE: forward browser script
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.
|
|
05-13-2006 10:48 AM |
|
 |
Pages: (3):
« First
«
1
[ 2 ]
3
»
Last »
|
|