View Single Post

  #3 (permalink)  
Old 04-10-2008
Ronald Raygun
 
Posts: n/a
Default Re: Using different stylesheets + generating HTML in PHP (how to)?



Floortje wrote:

> > 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>


Cool - thanks very much !
Reply With Quote