Parse Error Syntax Error Unexpected T_if In /home
Contents |
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 syntax error unexpected 'if' (t_if) in php Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation parse error syntax error unexpected 'if' (t_if) in php Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like parse error: syntax error, unexpected 'if' (t_if) wordpress you, helping each other. Join them; it only takes a minute: Sign up Parse error: syntax error, unexpected T_IF in…line 1 up vote 0 down vote favorite New to PHP and changed some code further down than parse error syntax error unexpected if t_if expecting line 1 on a WordPress site. Using Dreamweaver CC to upload. Getting: Parse error: syntax error, unexpected T_IF in /home/jodyrein/public_html/www.writersblogfinder.com/wp-content/themes/rockthebook/functions.php on line 1 at www.writersblogfinder.com Here is the first few lines of code:
Php Syntax Check Parse Error Syntax Error Unexpected 'if' (t_if) In Your Code
question edited Nov 24 '13 at 18:34 Anna 61.8k14154156 asked Nov 24 '13 at 18:31 netalexpg 11 Try hitting Enter after the php tag. –Mihai Nov 24 '13 at 18:38 Thanks but that didn't work. –netalexpg Nov 24 '13 at 18:43 Remove all the comments. –Mihai Nov 24 '13 at 18:45 Well now I've noticed when I download the file all the code is on one line:
Flow Forum View Course 218 points Submitted by Ouija the Neenjah over 3 years ago What am i doing wrong in "your first IF"? idk what
Parse Error Syntax Error Unexpected T_if Wordpress
im doing wrong but im sure im doing something wrong since its not syntax error unexpected in php going through lol. heres my code:
5); { echo "You get a 10% discount!"; } ?>
it says Parse error: syntax error, unexpected T_IF on line 9 http://stackoverflow.com/questions/20179220/parse-error-syntax-error-unexpected-t-if-in-line-1 and Oops, try again! Did you replace the second blank with { ? the second blank is where the { is.. 1 vote permalink You are missing the semicolon after $items = 10 The error code mentions line 9. Always look at that number since it tells you that your error is on the indicated or before the line indicated. 2933 points Submitted by tony https://www.codecademy.com/en/forum_questions/51871b0c92acc29f0e002653 de araujo over 3 years ago 1 Comment Ouija the Neenjah over 3 years ago thats actually really good advice ill keep that in mind from now on :) 1 vote permalink The variable needs a semicolon, so change it to "$items = 10;" 139 points Submitted by masterCameron101 over 3 years ago 0 votes permalink oh and on my screen this is what line 9 would be: if ($items > 5); { 218 points Submitted by Ouija the Neenjah over 3 years ago 3 Comments Muhammad Haroon over 3 years ago Are you mad? You should not add the semicolon after "if ($items > 5)" because the statement is not yet completed. However the code should be something like this: 5) { echo "You will get a 10% discount!"; } ?> tony de araujo over 3 years ago Lol, I didn't notice that one! It is definitely a no-no, it terminates the conversation even before it starts. Ouija the Neenjah over 3 years ago maybe i should retouch on my semi colon theories XD lulz 0 votes permalinIf this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link http://board.phpbuilder.com/showthread.php?10368529-RESOLVED-Parse-error-syntax-error-unexpected-T_IF-in above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 3 of 3 Thread: [RESOLVED] Parse error: syntax error, unexpected T_IF in Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 09-28-2009,07:49 PM #1 syntax error mattboy View Profile View Forum Posts Junior Member Join Date Sep 2009 Posts 2 [RESOLVED] Parse error: syntax error, unexpected T_IF in I continue to get an error, "Parse error: syntax error, unexpected T_IF in ....". I can not figure out why this is for the life of me. I am trying to input data into my DB from a form on my website. The form appears syntax error unexpected to work fine. Thanks, Matt Reply With Quote 09-28-2009,08:55 PM #2 NogDog View Profile View Forum Posts Visit Homepage High Energy Magic Dept. Join Date Aug 2006 Location Ankh-Morpork Posts 14,504 No terminal semi-colon at the end of the preceding command. PS: Welcome to the forum, and in future posts, please be sure to make use of this forum's [php]...[/php] bbcode tags around your PHP code samples in order to make it much easier to read. "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading) My Blog cwrBlog: simple, no-database PHP blogging framework Reply With Quote 09-28-2009,11:48 PM #3 mattboy View Profile View Forum Posts Junior Member Join Date Sep 2009 Posts 2 Thanks a lot for your quick reply. I got it working. Reply With Quote Quick Navigation Coding Top Site Area