Parse Error Syntax Error Unexpected T_if Expecting T_function In
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you syntax error unexpected if t_if in php might have Meta Discuss the workings and policies of this site
Syntax Error Unexpected 'if' (t_if) In Laravel
About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or parse error syntax error unexpected if t_if in php posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP, unexpected T_IF, expecting T_FUNCTION in xxx file on line xxx up vote 1 down vote favorite Very strange, I got code running on my localhost, but when I deployed it on remote server. it got T_IF error. The code is as follow: The xxx line is around: $experiment['import_result'] = TRUE; private function do_import($file_info, $ih_id){ $this->load->library("MY_PHPExcel"); $inputFileName = $file_info['full_path']; $sheetNames = array('General','Gas', 'Sample', 'Mass Gain', 'Cr'); /** Identify the type of $inputFileName **/ $inputFileType = PHPExcel_IOFactory::identify($inputFileName); /** Create a new Reader of the type that has been identified **/ $objReader = PHPExcel_IOFactory::createReader($inputFileType); /** Advise the Reader that we only want to load cell data **/ $objReader->setReadDataOnly(true); /** Advise the Reader of which WorkSheets we want to load **/ $objReader->setLoadSheetsOnly($sheetNames); /** Tell the Reader that we want to use the Read Filter **/ //$objReader->setReadFilter($filterSubset); /** Load $inputFileName to a PHPExcel Object **/ $objPHPExcel = $objReader->load($inputFileName); $sheetCount=$objPHPExcel->getSheetCount(); $experiment = array(); for($index = 0; $index<$sheetCount; $index++){ $objPHPExcel->setActiveSheetIndex($index); $sheetName = $objPHPExcel->getActiveSheet()->getTitle(); if($sheetName == 'General'){ $experiment['general'] = $this->read_general($objPHPExcel, $index, 1); }elseif($sheetName == 'Sample'){ $experiment['sample'] = $this->read_sample($objPHPExcel, $index, 1); }elseif($sheetName == 'Gas'){ $experiment['gas'] = $this->read_gas($objPHPExcel, $index, 1); }elseif($sheetName == 'Mass Gain'){ $experiment['mass'] = $this->read_mass($objPHPExcel, $index, 1); }elseif($sheetName == 'Cr'){ $experiment['cr'] = $this->read_cr(
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: http://stackoverflow.com/questions/12994653/php-unexpected-t-if-expecting-t-function-in-xxx-file-on-line-xxx Sign up unexpected 'if' (T_IF), expecting ',' or ';' up vote -3 down vote favorite I'm trying to create a secure multi-file upload script for a private cloud storage system. I dont know what I have done is any good as I started learning php 3 weeks ago. I keep getting an error on line 59: if(move_uploaded_file($_FILES['file']['tmp_name'], $upload_dir)); and I dont know http://stackoverflow.com/questions/28410045/unexpected-if-t-if-expecting-or where I am going wrong. If someone can help me that woud be great. This is my html
This is my php $tmp_name) { $file_name = $_FILES['files']['name'][$key]; $file_size = $_FILES['files']['size'][$key]; $file_type = $_FILES['files']['type'][$key]; $file_tmp = $_FILES['files']['tmp_name'][$key]; //check files are nohere for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About http://stackoverflow.com/questions/30093799/parse-error-syntax-error-unexpected-if-t-if-expecting-function-t-functio Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Parse error: syntax error, unexpected syntax error 'if' (T_IF), expecting function (T_FUNCTION) in /server/disk_1/websites/makemyrice/cart_update.php on line 7 [duplicate] up vote -5 down vote favorite This question already has an answer here: PHP Parse/Syntax Errors; and How to solve them? 10 answers i received this error while loading this page. the error is like this, Parse error: syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) in /server/disk_1/websites/makemyrice/cart_update.php on line 7 the line number 7 syntax error unexpected is "if(isset($_COOKIE['cards']))" php share|improve this question edited May 7 '15 at 6:49 asked May 7 '15 at 6:48 Johnson Antony 32 marked as duplicate by leo, karthik, Nadeem_MK, Rizier123, John Condephp Users with the php badge can single-handedly close php questions as duplicates and reopen them as needed. May 7 '15 at 11:34 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 3 Error message is clear, isn't it? Inside a Class only functions are allowed, nothing else. –panther May 7 '15 at 6:50 so how could fix this error. ? –Johnson Antony May 7 '15 at 6:56 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accep