Ok, I am a newb to PHP, but I have a good backing in C++ and Java so I have been able to eek out what I need.
I was going though a 'mambo' conversion of a web plug in for Smart launch, a cafe' administration program.
Here is my code:
I keep getting an error though mambo of this "Warning: file_get_conten ts(data.dat): failed to open stream: No such file or directory in E:\inetpub\vhos ts\pixelated.co m\subdomains\XG N\httpdocs\CMS\ modules\mod_com puterStatus.php on line 22 "
The file "data.dat" is in the correct directory, and my Smart Launch server has and does update to it correctly; but the code still can't see it. What am I doing wrong?
I was going though a 'mambo' conversion of a web plug in for Smart launch, a cafe' administration program.
Here is my code:
Code:
$filename = 'data.dat';
$postvars = unserialize(file_get_contents($filename));
$i = 0;
for($i = 0; $i <= $postvars['ComputerCount']; $i++)
{
switch($postvars['Computer' . $i . '_State'])
{
case '0':
$statustext = "Unavailable / Off";
break;
case '1':
$statustext = "Available for use!";
break;
case '2':
$statustext = "Unavailable / In Use";
break;
}
switch($postvars['Computer' . $i . '_ConsoleType'])
{
case '0':
?>
<div style="position:absolute;top:<? echo $postvars['Computer' . $i . '_X']; ?>px;left:<? echo $postvars['Computer' . $i . '_Y']; ?>px;width:32px;height:32px;" onmouseover="return escape('<b>Computer #<? echo $i ?><br>Status:</b> <? echo $statustext ?>')">
<img src="images/pc_<? echo $postvars['Computer' . $i . '_State']; ?>.png" alt="Computer #<? echo $i ?>">
</div>
<?
break;
case '1':
?>
<div style="position:absolute;top:<? echo $postvars['Computer' . $i . '_X']; ?>px;left:<? echo $postvars['Computer' . $i . '_Y']; ?>px;width:32px;height:32px;" onmouseover="return escape('<b>XBOX<br>Status:</b> <? echo $statustext ?>')">
<img src="images/xbox_<? echo $postvars['Computer' . $i . '_State']; ?>.png" alt="xbox"><br>
</div>
<?
break;
case '2':
?>
<div style="position:absolute;top:<? echo $postvars['Computer' . $i . '_X']; ?>px;left:<? echo $postvars['Computer' . $i . '_Y']; ?>px;width:32px;height:32px;" onmouseover="return escape('<b>PS2<br>Status:</b> <? echo $statustext ?>')">
<img src="images/ps2_<? echo $postvars['Computer' . $i . '_State']; ?>.png" alt="ps2"><br>
</div>
<?
break;
}
}
?>
<script language="JavaScript" type="text/javascript" src="wz_tooltip.js"></script>
I keep getting an error though mambo of this "Warning: file_get_conten ts(data.dat): failed to open stream: No such file or directory in E:\inetpub\vhos ts\pixelated.co m\subdomains\XG N\httpdocs\CMS\ modules\mod_com puterStatus.php on line 22 "
The file "data.dat" is in the correct directory, and my Smart Launch server has and does update to it correctly; but the code still can't see it. What am I doing wrong?
Comment