Zend Studio rocks.
It works like this:
PHP Code:
/**************************************************************************************
Browser Detection is provided by Leon Atkinson <leon@clearink.com>
/*------------------------------------------------------------------------------------*/
Notice that I removed the slash after the line of stars, which was closing the comment and causing the string to be parsed by PHP.
I would suggest you change it into:
PHP Code:
/**********************************************************************
* *
* Browser Detection is provided by Leon Atkinson <leon@clearink.com> *
* *
**********************************************************************/
Or if you want to be tha bomb and make it phpdoc compatible (phpdoc rules!) and generally more compact and human readable you could rewrite your code as follows:
PHP Code:
<?php
getBrowserInfo();
/**
* The plot cam function
*/
function plot_cam()
{
global $filename,$img,$pause;
$k = 0;
Header("Content-type: multipart/x-mixed-replace;boundary=ThisRandomString");
while ($img[$k]==$filename)
{
print("\n--ThisRandomString\n\n");
Header("Content-type: text/plain");
$cam = fopen($filename,"r");
fpassthru($cam);
fclose($cam);
if ($pause) { sleep($pause);} // time between reload, usefull for server usage
$k++;
if ($k==count($img)) echo("\n--ThisRandomString--\n");
}
}
/**
* Browser Detection is provided by Leon Atkinson <leon@clearink.com>
*/
function getBrowserinfo()
{
/* Get the name the browser calls itself and what version */
$Browser_Name = strtok($HTTP_USER_AGENT, "/");
$Browser_Version = strtok(" ");
/* MSIE lies about its name */
if(ereg("MSIE", $HTTP_USER_AGENT))
{
$Browser_Name = "MSIE";
$Browser_Version = strtok("MSIE");
$Browser_Version = strtok(" ");
$Browser_Version = strtok(";");
}
/* Opera isn't completely honest, either ... */
/* Modificaton by Chris Mospaw <mospaw@polk-county.com> */
if(ereg("Opera", $HTTP_USER_AGENT))
{
$Browser_Name = "Opera";
$Browser_Version = strtok("Opera");
$Browser_Version = strtok("/");
$Browser_Version = strtok(";");
}
/* try to figure out what platform, windows or mac */
$Browser_Platform = "unknown";
if(ereg("Windows",$HTTP_USER_AGENT)
|| ereg("WinNT",$HTTP_USER_AGENT)
|| ereg("Win95",$HTTP_USER_AGENT))
$Browser_Platform = "Windows";
if(ereg("Mac", $HTTP_USER_AGENT))
$Browser_Platform = "Macintosh";
if(ereg("X11", $HTTP_USER_AGENT))
$Browser_Platform = "Unix";
if(($Browser_Platform == "Windows"))
{
if($Browser_Name == "Mozilla")
{
// SERVER PUSH WORK'S ONLY HERE <img src="images/smilies/smile.gif" border="0" alt="">
if($Browser_Version >= 4.0) plot_cam();
}
}
elseif($Browser_Platform == "Macintosh")
{
if($Browser_Name == "Mozilla")
{
// SERVER PUSH WORK'S ONLY HERE <img src="images/smilies/smile.gif" border="0" alt="">
if($Browser_Version >= 4.0) plot_cam();
}
}
elseif($Browser_Platform == "Unix")
{
if($Browser_Name == "Mozilla")
{
// SERVER PUSH WORK'S ONLY HERE <img src="images/smilies/smile.gif" border="0" alt="">
if($Browser_Version >= 4.0) { plot_cam();}
}
}
}
?>
But that is just my style, doesn't have to be yours.