Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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'); 

  • #3
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •