SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting T_CONSTANT_ENCAPSED_STRING error

    Parse error:syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘,’ or ‘;’ in /home/content/39/7897939/html/wp-content/plugins/db-toolkit/data_report/templatemode.php(453) : eval()’d code on line 11

    I know the error occurs in this segment of code, because if I remove this segment, the error goes away. CANNOT find what it might be!!

    Code:
    <?php 
    	$caresheetlink = '{{caresheetlink}}'; 
    	$gallerylink = '{{gallerylink}}'; 
    	if ((!empty($caresheetlink)) && (!empty($gallerylink))) {
    		echo '<div class="sp-btn-first"><span class="spbutton"><div class="sp-button" onClick="parent.location='{{caresheetlink}}'"><span>Care Sheet</span></div></span></div><div class="sp-btn"><span class="spbutton"><div class="sp-button" onClick="parent.location='{{gallerylink}}'"><span>Photo Gallery</span></div></span></div>';
    	}
    ?>

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,500
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    You are using single quotes in a string that is encapsulated by single quotes. Escape those single quotes inside the string with \

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bingo! Thank you! Didn't realize that was necessary, but had a hunch it had to do with them.


Bookmarks

Posting Permissions

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