<?php // Read the current control signal if a get variable is passed if (isset($_GET['tracker'])){ $currentTracking=$_GET['tracker']; }else{ // Read the current control signal from file otherwise $file = fopen("tracker.php", "r"); $currentTracking=fgets($file); fclose($file);} ?> <?php $file = fopen("movieinfo.php", "r"); $uniquesignal = fgets($file); $srcname = trim(fgets($file)); $srcwidth = 0; $srcheight = 0; if ($uniquesignal == 0 || $currentTracking == 0){ $srcwidth = trim(fgets($file)); $srcheight = trim(fgets($file));} fclose($file); if ($uniquesignal == 1 && $currentTracking != 0){ $srcname .= "_" . $currentTracking; if (!isset($_GET['tracker'])){ $currentTracking += 1; $file = fopen("tracker.php","w"); fwrite($file,$currentTracking); fclose($file); } } if ($uniquesignal == 2 && $currentTracking != 0){ $srcname .= "_audio"; } ?> <html> <head> <script language="Javascript" type="text/javascript" src="script.js"></script> <script language="Javascript" type="text/javascript"> // Helper function to pass php functionality to the javascript-only external file function beginCode(){ setCurrentTracker(<?php echo $currentTracking; ?>);} // Begin code execution beginCode(); </script> <title>RTF 331: Soundscapes Project 2</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body bgcolor="Black" id="indexBody"> <div id="indexWrapper"> <OBJECT classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="180" height="160" id="movie1" > <PARAM name="scale" value="tofit"> <EMBED width="<?php echo $srcwidth ?>" height="<?php echo $srcheight ?>" scale="tofit" src="<?php echo $srcname ?>.mov" name="movie1" autoplay="false" enablejavascript="true" loop="false" controller="false"> </EMBED> </OBJECT> <input type="hidden" id="txt" /><!-- Debugging text box, initially hidden --> <div id="trackingNum"></div><!-- Tracking number display placeholder --> </div> </body> </html>