www.webdeveloper.com
Results 1 to 3 of 3

Thread: unexpected $end

  1. #1
    Join Date
    Dec 2010
    Posts
    130

    unexpected $end

    Anyone knows why im having this error: Parse error: syntax error, unexpected $end in CODE on line 78 Errors parsing CODE
    this code worked last week and now it just started to give this error.
    Code:
    <html><head></head><body>
    
    
    
    <?php
    ini_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

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,176
    You left out a closing "}".
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Dec 2010
    Posts
    130
    Thanks i hate this situations

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles