Parse error: syntax error, unexpected $end in /home/caliberg/public_html/index.php on line 42
Syntax errors are the most common problem for developers. A single syntax error can cripple even the best applications and websites. You can correct syntax errors easily once you find them. Typical errors include missing commas, semicolons and parenthesis. Debuggers are available in many software development kits to aid you in the location of syntax errors. However, you can find and correct syntax errors manually as well. Learning how to correct syntax errors is an essential part of being a software developer.
Locate the syntax error manually. Step through each section of your code. Most code will be sectioned off into groups or functions. Carefully proof your code. Be sure to pay close attention to how lines are grouped. A common syntax mistake is incorrect grouping.
For instance, if you have an If Else statement embedded in another If Else statement, be sure the embedded statement is surrounded by a separate set of parenthesis or brackets, depending on your language. Double-check notes sections. Notes are only for the developer to see. However, if the syntax isn't correct, the notes may become part of your application, which may not agree with existing code. Ensure the syntax around your notes is correct. Run a debugger if possible. This will make locating errors much easier. A debugger will be found under a menu such as Debug, Run or Tools or as part of your SDK's toolbar. Allow the debugger to run. Errors will be listed at the bottom or right side of your screen. Many debuggers will highlight possible errors in your code as well. A line number, along with the possible error, will be listed in the error message. Locate your syntax error if the debugger isn't correct. Sometimes a debugger will show you where your application stopped working correctly. The syntax error itself may be above or below the line listed in the debugger message. Check all syntax within the surrounding area, especially within the line's function. Run your application after correcting the syntax error. Check every possible function of your application to ensure it works correctly. If you find a problem, double-check the syntax in your code that surrounds the problem area. For instance, if your application has a log-in screen that isn't accepting passwords correctly, check the code for the log-in screen. Remove Syntax Error syntax error typically occurs when the Web page you are loading causes a script error in the browser. This is caused by incorrect code that displays an error message or results in a Web page that does not load correctly. You can remove a syntax error by making a change to the settings of your Web browser. Common Web browsers that can experience this type of error include Internet Explorer, Mozilla Firefox and Safari.
Double-click the "Internet Explorer" icon to open the program. Click the "Tools" drop-down menu and select "Internet Options." This will display the Internet Options window. Go to the "Advanced" tab and scroll down to the "Browsing" section. Remove the check from the box for "Disable script debugging (Internet Explorer)," "Disable script debugging (Other)" and "Display a notification about every script error." Click the "Apply" button to save the changes. Click the "OK" button to close the Internet Options window. Close and restart the Internet Explorer browser for the changes you made to take effect. b> Mozilla Firefox b> Double-click the "Mozilla Firefox" icon to open the program. Type "about:config" into the address bar and press the "Enter" key. Type "dom.max_script_run_time" into the Filter text box and press the "Enter" key. Double-click "dom.max_script_run_time" to display the Enter Integer Value dialog box. Enter a value of "10" or "15" into the text box and click the "OK" button to save the change. Close and then restart the Firefox browser for the change to take effect. b> Safari b> Click the "Safari" icon to open the Web browser. Select the option for "Preferences" from the menu bar. Go to the Advanced tab and click the option for "Show Develop menu in menu bar." Click the option for "Develop" from the menu bar. Click the option for "Disable Runaway JavaScript Timer." Close and re-open the browser for the change to take effect.
b>
b>
SOURCE: Parse error: syntax error, unexpected
T_STRING is a string error. It usually means one of two things.
1. The string is formatted incorrectly. In your case check on line 4. Make sure if you have a ' that you close it with a '. Same with ". Close all " with another " somewhere. Make sure line 4 ends wth semi-colon ;
2. Usually this is the case. The line above the string it states doesn't have a semi-colon to complete the statement. In your case, check that line 3 ends with a ;
That is why it says unexpected T_STRING which means "unexpected string". The string on line 4 is unexpected because line 3 wasn't closed properly.
174 views
Usually answered in minutes!
×