Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vicki Hendra

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

    Hi
    I am new to php fullstop
    I and colleagues have setup wordpress blogs for our local towns, giving the local businesses free advertisment.
    Part of the problem started when using wordpress plugins/business-directory.
    when the form is filled in with the business information, for some reason the description field is not allowing all the details to be present when they are accessed.
    When accessing wordpress forums, it was noted that I was not the only one with this problem. There appeared to be a bug in the Beta 8.5 version.
    Being:wp.conten t/Plugins/business-directory/functions.php
    Lines: 250-258
    There were a few experienced in php giving their solutions to the problem.
    They were working for some and not others, myself being one of them.
    I kept a copy of the original lines250-258 in notepad, and after attempting an alternate option replaced the original setup.
    This for some resaon did not work either and ever since I have been having Parse errors: syntax errors. and once I put one part right another one appears.

    Parse error: syntax error, unexpected T_CONSTANT_ENCA PSED_STRING in /home/market71/public_html/neathv.com/wp-content/plugins/business-directory/functions.php on line 238
    this is the (foreach Listing)
    Your help in sorting this out would be appreciated, as another problem has arisen again with the business-directory, but have not done anything to sort it out yet.
    I prefer to sort one problem as a time.

    thank You
    Vicki

    My functions.php file is below which I have marked line 238


    Code:
    //Display Listings
    $directory .= "<table width='100%' border='0' cellspacing='0' cellpadding='0' id='bizdir_directory'>";
    if(!empty($searchTerms))
    $directory .= 
    "<tr><th style='text-align:center;padding:5px 15px 10px 15px;'>".
    "<b>Search results for: \"$searchTerms\"</b><br/>".
    ["<small><a style='cursor:pointer;' onClick='bizdir_change_listings_page(0);'>View Entire Directory</a></small>". "</th></tr>""<tr><td>"."<b>".;
    (line238:)	foreach($listings as $l) {
    		$directory .= 
    		"<div class='bizdir_listing'>".
    		"<divclass='bizdir-title'>".
    if(!empty($l["company_url"])?
    str_replace("&Acirc;&","&",@$l["company_name"]):
    "<a href='".$l["company_url"]."' class='bizdir_linked_title' target='_blank'>".
    str_replace("&Acirc;&","&",@$l["company_name"]):"</a>" )."</b>". "</div>"
    if(!empty($l["company_url"]):
    $directory .= "<a href='".@$l["company_url"]."' target='_blank' title='".@$l["company_name"]."'>".@$l["company_url"]."</a><br/>";
    if(!empty($l->company_email))
    $directory .= "<a href='mailto:".@$l["company_email"]."'>".@$l["company_email"]."</a><br/>";
    if(!empty($l->company_phone))
    $directory .= @$l["company_phone"]."<br/>";
    $directory .= "</td></tr>";]
    Last edited by Atli; Nov 10 '10, 01:44 PM. Reason: Please use [code] tags when posting code.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    On line #237 (#7 in the code above) there is a [ in between the strings you are adding. This is most likely causing your parse error. Removing it should fix that.

    Comment

    • Vicki Hendra

      #3
      Hi Alti

      Thanks for your suggestion, I had to put that tag in to make it 20 lines. Tried with tags at the begining of codeing and question was being rejected.
      Excluding the tag on line #237 can you find anthing else
      wrong with the coding.

      Comment

      Working...