syntax error (stumped)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is acctualy a very simple code... But I dont know exactly what to do
with line 18. It looks to be taking something from dox and redefining it as
RES. There is some related code but with syntax is pretty much has to be
this one.


//Example//

<?
require "include/bittorrent.php";
dbconn();
if (!$CURUSER)
{
header("Location: ".$BASEURL);
die;
}
$filename = substr($_SERVER["PATH_INFO"], strrpos($_SERVER["PATH_INFO"],
"/") + 1);
if (!$filename)
  stderr( _("Error"), _("Filename missing") );
  
if (get_user_class() < UC_POWER_USER && filesize("$DOXPATH/$filename") >
1024*1024)
  stderr( _("Error"), _("Sorry, you need to be a power user or higher to
download files larger than 1.00 MB.") );
  

$filename = sqlesc($filename);
$res = do_mysql_query("SELECT * FROM dox WHERE filename=$filename") or
sqlerr();
$arr = mysql_fetch_assoc($res);
if (!$arr)
stderr( _("Error"), _("File Not found"));
do_mysql_query("UPDATE LOW_PRIORITY dox SET hits=hits+1 WHERE id=$arr[id]")
or sqlerr();
$file = "$DOXPATH/$arr[filename]";
header("Content-Length: " . filesize($file));
header("Content-Type: application/octet-stream");
readfile($file);
?>

//end example//

this is line 18 :  $res = do_mysql_query("SELECT * FROM dox WHERE
filename=$filename") or sqlerr();

Any Help would be great.. Im lost here.... Near as I can tell this should be
legal.. but I not sure about hows its done.

Thanks
Sailor
-- 
View this message in context: http://www.nabble.com/syntax-error-%28stumped%29-tp20846197p20846197.html
Sent from the PHP - General mailing list archive at Nabble.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux