If you build a website based on firefox and on IE the display is degraded here wath you can do :
MAKE THIS STRUCTURE ON YOU FTP
www
- [site_files]
- index.phpl
IN - index.php paste the following code
USAGE: you will find $browser = 'Netscape (Gecko/Netscape)'; for example. That will display wath kind of browser you are running. Now you can remove it or add the command you like. Put your codes between the IF command bracket {}
EXAMPLE
...
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') )
{
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape') )
{
$browser = 'Netscape (Gecko/Netscape)';
}
else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') )
{
$browser = 'Mozilla Firefox';
?>
<META HTTP-EQUIV='Refresh'CONTENT='5; URL="http://localhost/site_files/index.php"'>
<?php
}
else {...}
EXPLANATION:
As you can see you can also break the php command and insert some html code (see red lines)
In the read lines above i've inserted a META that refresh after checking wait 5 sec and redirect to my desired URL
COMMANDS:
HTTP-EQUIV='Refresh' - do refresh
CONTENT='5 - do wait 5 sec
URL="http://localhost/site_files/index.php" - do redirect
ANOTHER FINE ONE FROM GIDevelop !!!
If you get into trouble post your questions here !!!
MAKE THIS STRUCTURE ON YOU FTP
www
- [site_files]
- index.phpl
IN - index.php paste the following code
| Code: |
| <html>
<head><title>Calatorul</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <?php if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') ) { if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape') ) { $browser = 'Netscape (Gecko/Netscape)'; } else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') ) { $browser = 'Mozilla Firefox'; ?> <META HTTP-EQUIV='Refresh'CONTENT='5; URL="http://localhost/site_files/index.php"'> <?php } else { $browser = 'Mozilla (Gecko/Mozilla)'; } } else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) { if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') ) { $browser = 'Opera (MSIE/Opera/Compatible)'; } else { $browser = 'Internet Explorer (MSIE/Compatible)'; ?> <META HTTP-EQUIV='Refresh'CONTENT='5; URL="noexp.php"'> <?php } } else { $browser = 'Others browsers'; } echo $browser; ?> </body> </html> |
USAGE: you will find $browser = 'Netscape (Gecko/Netscape)'; for example. That will display wath kind of browser you are running. Now you can remove it or add the command you like. Put your codes between the IF command bracket {}
EXAMPLE
...
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') )
{
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape') )
{
$browser = 'Netscape (Gecko/Netscape)';
}
else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') )
{
$browser = 'Mozilla Firefox';
?>
<META HTTP-EQUIV='Refresh'CONTENT='5; URL="http://localhost/site_files/index.php"'>
<?php
}
else {...}
EXPLANATION:
As you can see you can also break the php command and insert some html code (see red lines)
In the read lines above i've inserted a META that refresh after checking wait 5 sec and redirect to my desired URL
COMMANDS:
HTTP-EQUIV='Refresh' - do refresh
CONTENT='5 - do wait 5 sec
URL="http://localhost/site_files/index.php" - do redirect
ANOTHER FINE ONE FROM GIDevelop !!!
If you get into trouble post your questions here !!!
