View Single Post

  #2 (permalink)  
Old 04-09-2008
Floortje
 
Posts: n/a
Default Re: Using different stylesheets + generating HTML in PHP (how to)?

> I am new to PHP (I'm a C++ programmer), so I would appreciate it if
> someone could show me how to do the following:




> 1). Write a function to determine the UA (user agent - i.e. browser) type


somethin like
$cssfile = (stristr($_SERVER['HTTP_USER_AGENT','msie'))?'ie.css':'ff.css';


> 2). generate html page with the appropriate css file link.


> <html>
> <head>
> <title>This is a test</title>


<link rel="stylesheet" type="text/css" href="<?php echo $cssfile; ?>" />


> </head>
> <body>Some text goes here ...</body>
> </html>

Reply With Quote