Capnstank Posted October 26, 2009 Share Posted October 26, 2009 I finished* coding a php page to upload a file onto my web server and insert certain information into a database but when attempting to run it I get an error in my log: [Mon Oct 26 10:16:28 2009] [error] [client 192.168.1.211] PHP Parse error: syntax error, unexpected T_VARIABLE in /var/www/tracker/upload_file.php on line 86, referer: http://192.168.1.211/form.html Here's the relevant code.... $torrent_metadata_size = filesize($file["tmp_name"]); //retrieve metadata file size if ($torrent_metadata_size == 0) //0 length file $returnString = "<p CLASS=\"err\">Torrent with length of 0 (zero) bytes uploaded. ". "Please check your torrent.</p>"; else { //Obtain file information $fd = fopen($file["tmp_name"], "rb") ----> $alltorrent = @fread($fd, $torrent_metadata_size); $array = BDecode($alltorrent); fclose($fd); .... The arrowed line is throwing the error. I'm not certain where I should begin debugging this code. Can anyone assist? -Capn Link to comment https://forums.phpfreaks.com/topic/179070-solved-unexpected-t_variable-error/ Share on other sites More sharing options...
Bricktop Posted October 26, 2009 Share Posted October 26, 2009 Hi Capnstank, You're missing the ending ; on the following line: $fd = fopen($file["tmp_name"], "rb") Change it to: $fd = fopen($file["tmp_name"], "rb"); Hope this helps. Link to comment https://forums.phpfreaks.com/topic/179070-solved-unexpected-t_variable-error/#findComment-944771 Share on other sites More sharing options...
Capnstank Posted October 26, 2009 Author Share Posted October 26, 2009 Haha that's embarrassing! I had no clue what T_Variable meant so I immediately starting going... ok, wtf is fread, fopen, "rb" etc. Thanks! Link to comment https://forums.phpfreaks.com/topic/179070-solved-unexpected-t_variable-error/#findComment-944811 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.