razstec Posted April 5, 2012 Share Posted April 5, 2012 Anyone knows why im having this error: Parse error: syntax error, unexpected $end in CODE on line 78 Errors parsing CODEthis code worked last week and now it just started to give this error. <html><head></head><body><?phpini_set('display_errors', 1);ini_set('log_errors', 1);ini_set('error_log', dirname(__FILE__) . 'error_log.txt');error_reporting(E_ALL);set_time_limit(0);$out = array('error'=>null);if ($_POST["stud"]=="" || $_POST["pat"]=="" || $_POST["data_cfp7"]="" || $_POST["visit"]=="" || $_POST["exam"]=="" || $_POST["centro"]=="" || $_FILES['arquivo']=="") { $out['error'][] = "There are empty fields, please check again!"; } else {$dataup = date("d-m-Y");$dataexam=$_POST["data_cfp7"];$pat=$_POST["pat"];$visit=$_POST["visit"];$stud=$_POST["stud"];$exam=$_POST["exam"];$center=$_POST["centro"];$arquivo =$_FILES['arquivo'];$novonome =$dataup.'_'.$stud.'_'.$exam.'_'.$center.'_'.$pat.'_'.$visit.'_'.$dataexam.'.zip';$dir =$stud."/".$pat."/";$caminho =$dir.$novonome;$servidor ='71.21.78.75';$user='user';$pass='1234';$conn_id = ftp_connect($servidor) or die( 'No Connection'); if ($_FILES["arquivo"]=="") { $out['error'][] = "Please specify a file"; } if ($arquivo['type'] == "multipart/x-zip" || $arquivo['type']== "application/zip" || $arquivo['type'] == "application/x-zip-compressed" || $arquivo['type'] == "application/x-compressed") { } else { $out['error'][] = "Only Zip files are allowed!"; } if ($arquivo['size']>500000000) { $out['error'][] = "File upload limit is 500MB!"; }ftp_login( $conn_id, $user, $pass ); if (count($out['error'])>0) { foreach ($out['error'] as $msg) { $message = '<p>'.$msg.'</p>'; echo $message; echo "<br><form><input type=\"button\" value=\"Return to previous form\" onClick=\"javascript:history.go(-1)\"></form>"; } } else { if (!in_array($stud, ftp_nlist($conn_id, ''))) { ftp_mkdir($conn_id, $stud) or fail ($out['error'][] ="Cannot create dir $stud."); } if (!in_array($pat, ftp_nlist($conn_id, $stud))) { ftp_mkdir($conn_id, $stud.'/'.$pat) or fail ($out['error'][] ="Cannot create dir $pat."); } ftp_put( $conn_id, $caminho, $arquivo['tmp_name'], FTP_BINARY); ftp_close($conn_id); echo "<script>history.back();</script>"; }?></body></html><-------------------------Line 78 Link to comment Share on other sites More sharing options...
dsonesuk Posted April 5, 2012 Share Posted April 5, 2012 count '{' compared to '}', you are missing one '}' Link to comment Share on other sites More sharing options...
astralaaron Posted April 6, 2012 Share Posted April 6, 2012 at times like this it is handy to be using a text-editor that highlights the closing bracket when you click beside an opening bracket Link to comment Share on other sites More sharing options...
razstec Posted April 9, 2012 Author Share Posted April 9, 2012 Thanks i hate this situations Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.