Question

I keep getting this php error:

Parse error: syntax error, unexpected end of file in /home/ExpandHosting/www/FTP/ftp.php on line 635

I have tried googling around and all I find is that I forgot to close a if statement or similiar. I have tried reading through my file several times but I can't find where I messed up. This happened after I started commenting a lot so I might have removed/commented a bracket but I can't find it!

Here is the source code: http://pastebin.com/xyY8EN2W

Était-ce utile?

La solution

Protip: Use your code editor's "Find" feature, type in {, then tell it to count the matches. Then repeat with }. If the numbers don't match, odds are high you missed a brace.

Aside: Obviously, you may have a string that may not necessarily contain perfectly matches braces. In this case, I like to add a comment with the brace(s) needed to match the numbers. Example: preg_match("/\{abc.*/",$str); // }

In your case, it's 68 vs. 67.

Now use your code editor's bracket matching feature to find out which one is missing.

If your code editor doesn't have these features, use one that does (personal preference is Notepad++)


240.                if(file_exists($folderPath . "/" . $fileName))
241.                {
242.                        error($fileName . " already exists!!!");
243.                        $error = true;
244.      // MISSING } HERE!!          
245. 
246. 
247.                # Checks if $file doesn't exist!
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top