Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-15-2013, 03:28 PM   PM User | #1
ssshawhan
New to the CF scene

 
Join Date: Feb 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
ssshawhan is an unknown quantity at this point
Please Help me with an unexpected T_STRING error

Hi!

Total newbie to coding here. I really need some help... My site is giving me the following error message:

Parse error: syntax error, unexpected T_STRING in /home/your2012/public_html/TanningAdvice/wp-load.php on line 50

This is what is on line 50 in the wp-load.php file:

wp_die(sprintf(/*WP_I18N_NO_CONFIG*/"There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.</p><script type="text/javascript

Can anybody help me figure out what to do to correct this?

Many thanks in advance for any help!
ssshawhan is offline   Reply With Quote
Old 02-15-2013, 04:49 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Yep, if you wrap this in PHP tags you can see it as well. I'll complete the line with just closing it:
PHP Code:
wp_die(sprintf(/*WP_I18N_NO_CONFIG*/"There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.</p><script type="text/javascript">...")); 
See the colour change at the end? text/javascript is now a part of the PHP code and not a part of the string (ie: you are dividing constant text by constant javascript, but what matters to this error is what follows it). You cannot use double quotes within double quotes (or single quotes within single) unless you escape them with \ (ie: script type=\"text/javascript\").
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Old 02-15-2013, 07:57 PM   PM User | #3
ssshawhan
New to the CF scene

 
Join Date: Feb 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
ssshawhan is an unknown quantity at this point
Thank you again! Unfortunately, after making the changes you noted I am now getting

Parse error: syntax error, unexpected T_VAR in /home/your2012/public_html/TanningAdvice/wp-load.php on line 52

with line 52 being

var div_colors = new Array('#4b8272', '#81787f', '#832f83', '#887f74', '#4c3183', '#748783', '#3e7970', '#857082', '#728178', '#7f8331', '#2f8281', '#724c31', '#778383', '#7f493e', '#3e4745', '#3d4444', '#3d4043', '#3f3d41', '#3f423e', '#79823e', '#798084', '#748188', '#3d7c78', '#7d3d7f', '#777f31', '#4d0000');

Look familiar? I think this is the same string I'm having trouble with in my other site...

Sorry for the trouble, but still needhelp.
ssshawhan is offline   Reply With Quote
Old 02-15-2013, 11:17 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
T_VAR isn't the same but can be caused by the same. Especially with the use of JS since you issue a var jsvar command, and var is valid in PHP within the context of a PHP 4.x OO member property.
Escape the strings. You can also look at using the heredoc syntax which allows either quotations in a non quoted string.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:33 PM.


Advertisement
Log in to turn off these ads.