|
|
|
| Title : |
Browser Detection, Redirection Type, MSIE, MOZILLA, Netscape Navigator, NS, $HTTP_USER_AGENT, HTTP_USER_AGENT |
| Categories : |
PHP, HTTP, Browsers, HTML and PHP |
 Josh Tuttle |
| Date : |
Feb 11th 2000 |
| Grade : |
3 of 5 (graded 9 times) |
| Viewed : |
10909 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by Josh Tuttle |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
<?php
// Obviously this is the simplest script in the world but it's still nice.
// All it does is tell the user what Browser they are using, which isn't help full
// but you can put HTML into $page and display certain HTML for NON-IE and different
// ones for MSIE, which is very nice!
// daedalus@flash.net
// P.S. Delete all this crap after the '//'
$Browser_Type = strtok($HTTP_USER_AGENT, "/");
if(ereg( "MSIE", $HTTP_USER_AGENT))
{
$page = "YOU ARE USING IE"; // This is all the stuff that will work in MSIE like xml, etc.
}
else
{
$page = "YOU ARE NOT USING IE"; // This is for stuff that you doesn't work in NS or AOL
so you put a subsitute code
}
?>
<html>
<head>
<title>Browser</title>
</head>
<body>
<? echo $page; ?>
</body>
</html> |
|
| PHP4 HTTP Compression Speeds up the Web Categories : PHP, Zlib, HTML and PHP, HTTP, Network | | | How to force the user to download a file instead of opening it up in an
controlled environment within the browser (i.e. MS Word/Adobe Acrobat) Categories : Browsers, PHP, HTTP | | | This script shows you the 7th latest php items from the mailing list archive on zend.com Categories : HTML, HTML and PHP, HTTP, PHP | | | Pseudo Non Parsed Header. Output to the the browser as the script runs. Categories : PHP, HTTP, HTML and PHP | | | Produces browser-safe strings while preserving HTML tags. Categories : Strings, HTTP, PHP, HTML and PHP | | | How to let a user download a picture by clicking on it instead of needing to right click and Save-As. Categories : HTTP, PHP, HTML and PHP, Filesystem | | | Upload Script, Upload File Script, Input Type="File" Categories : PHP, HTML and PHP, HTTP | | | PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use! Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP | | | A simple class with some HTML output functions that would come in handy for consistent page layout etc. Categories : PHP, PHP Classes, HTML and PHP, HTML, Navigation | | | Calendar using Date function Categories : HTML and PHP, PHP, Date Time, Calendar | | | phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install. Categories : PHP, Complete Programs, HTML and PHP, MySQL | | | Constantly refresh your PHP/HTML page data. Categories : PHP, HTML and PHP, Sybase | | | Select with current month Categories : PHP, HTML and PHP, Date Time, Arrays | | | PHP4 session helper HTML file.
Categories : PHP, Java Script, HTML and PHP, Sessions | | | html split bar used to split in multiple pages a database result Categories : HTML and PHP, Databases, MySQL, PHP | |
| | | | wrote :226
OPPS on the // This is for stuff that you doesn`t work
in NS or AOL
I meant
// This is for stuff that you DOES work in NS or AOL,
crap that won`t work in MSIE, like some CSS`s, XML,
ILAYERs, and MSIE only JavaScript and DHTML
So don`t put any DHTML and crap in the else $page
Boy i like using crap, eh?
| |
|
|
|