Forum Moderators: coopster
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/zackpowe/public_html/downloads/test/index.php on line 63
Here is the code including line 63:
<?
$size = 0;
for($i=0;$i<=$count;$i++) {
$file = $file_list[$i];
this is line 63->$path = "/home/url/public_html/downloads/audio/ . $row['username'] . "/";
if ($file!= "index.php" && $file!= "") {
?>
[/code]
Any help would be appreciated and thanks in advance.
Happy New Year
Parse error: parse error, unexpected $ in /home/zackpowe/public_html/downloads/audio2.php on line 113
<?php//prevents caching
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: post-check=0, pre-check=0",false);
session_cache_limiter();
session_start();
//require the config file
require ("/home/zackpowe/public_html/downloads/config.php");
require ("/home/zackpowe/public_html/downloads/functions.php");
// Connect to server and select databse.
mysql_connect("$server", "$dbusername", "$dbpassword")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
// Some functions
while($rows=mysql_fetch_array($result)){
$file_list = getDirFiles("/home/zackpowe/public_html/downloads/audio/" . $row['username'] . "/");
$count = count($file_list);
?>
<table border=0 width=100% bgcolor=0 cellpadding=5 cellspacing=0>
<tr>
<td bgcolor=#eeeeee style="font-family: Tahoma; font-size: 11px;"><b>
File Name (<? echo $rows['username'];?>)
</b></td>
<td bgcolor=#eeeeee style="font-family: Tahoma; font-size: 11px;"><b>
Size
</b></td>
<td bgcolor=#eeeeee style="font-family: Tahoma; font-size: 11px;"><b>
Date
</b></td>
</tr>
<?
$size = 0;
for($i=0;$i<=$count;$i++) {
$file = $file_list[$i];
$path = "/home/zackpowe/public_html/downloads/audio/" . $row['username'] . "/";
if ($file!= "index.php" && $file!= "") {
?>
<tr>
<td bgcolor=#ffffff style="font-family: Tahoma; font-size: 11px;">
<img src="/images/file.gif" align=middle> <a href="/audio/<?=$row['username']?>/<?=$file?>?key=<?=time()?>&validate=md5&log_user=<?=$userid?>"><?=$file?></a>
</td>
<td bgcolor=#ffffff style="font-family: Tahoma; font-size: 11px;">
<?=round(filesize($path . $file)/1024/1024, 2);?> MB
</td>
<td bgcolor=#ffffff style="font-family: Tahoma; font-size: 11px;">
<?=date("m/d/y H:i:s", filectime($path . $file));?>
</td>
</tr>
<?
}
}
function getDirFiles($dirPath)
{
if ($handle = opendir($dirPath))
{
while (false!== ($file = readdir($handle)))
if ($file!= "." && $file!= "..")
$filesArr[] = trim($file);
closedir($handle);
}
@sort($filesArr);
@reset($filesArr);
return $filesArr;
}
function fsize($file){
$size=0;
$range = Array ('B', 'K', 'M', 'G');
if(is_dir($file))
if ($dh = opendir($file)){
while (($filecnt = readdir($dh))!== false) {
if($filecnt == "." ¦¦ $filecnt == "..")continue;
if(is_dir($file."/".$filecnt))
$size += fsize($file."/".$filecnt);
else
$size += filesize($file."/".$filecnt);
echo "\n$file/$filecnt";
}
closedir($dh);
}else
return false;
else
$size = filesize($file);
for ($i = 0; $size >= 1024 && $i < count($range); $i++)
$size /= 1024;
return round($filesize,2).$range[$i];
print("</td></tr></table>");