Jump to content

Help me - Parse error: parse error, expecting `T_VARIABLE' or `'$''


arunkr

Recommended Posts

echo "</select></td>\r\n  </tr>\r\n \r\n <tr>\r\n <td align=\"right\">Total Views Allowed:</td>\r\n <td><input type=\"text\" id=\"ad_total_views\" style=\"width:50px;\" value=\"\" disabled=\"disabled\" /> <label><input type=\"checkbox\" checked=\"checked\" onclick=\"if(this.checked==true){$('#ad_total_views').val('');$('#ad_total_views').attr('disabled','disabled');}else{$('#ad_total_views').val('');$('#ad_total_views').removeAttr('disabled');$('#ad_total_views').focus()}\" />Unlimited</label></td>\r\n          </tr>\r\n            \r\n            <tr>\r\n              <td align=\"right\">Total Clicks  Allowed:</td>\r\n              <td><input type=\"text\" id=\"ad_total_clicks\" style=\"width:50px;\" value=\"\" disabled=\"disabled\" /> <label><input type=\"checkbox\" checked=\"checked\" onclick=\"if(this.checked==true){$('#ad_total_clicks').val('');$('#ad_total_clicks').attr('disabled','disabled');}else{$('#ad_total_clicks').val('');$('#ad_total_clicks').removeAttr('disabled');$('#ad_total_clicks').focus()}\" />Unlimited</label></td>\r\n          </tr>\r\n        </table></td>\r\n  </tr>\r\n    <tr bgcolor=\"#FFFFFF\">\r\n    <td class=\"td_th\" align=\"center\">Smarty Code (Developer)</td>\r\n    <td>{\$ads->getAdCode(<span id=\"smartycode\">1</span>)}</td>\r\n  </tr>\r\n    <tr bgcolor=\"#FFFFFF\">\r\n      <td class=\"td_th\" align=\"center\"> </td>\r\n      <td><input type=\"button\" value=\"Create New Campaign\" onclick=\"new_ad()\" /></td>\r\n    </tr>\r\n    </TBODY></TABLE>\r\n<br />\r\n\r\n<TABLE cellSpacing=1 cellPadding=4 width=\"100%\"  border=0>\r\n  <TBODY>\r\n  <TR class=\"td_title\">\r\n    <TD  colSpan=7>Ad Campaigns</TD></TR>\r\n  <TR bgColor=#ffffff>\r\n  \r\n    <TD width=\"10%\" align=\"center\" class=\"td_th\"> </TD>\r\n    <TD width=\"4%\" align=\"center\" class=\"td_th\">ID</TD>\r\n    <TD width=\"29%\" align=\"center\" class=\"td_th\">Campaign Name</TD>\r\n    <TD width=\"12%\" align=\"center\" class=\"td_th\">Start Date</TD>\r\n    <TD width=\"11%\" align=\"center\" class=\"td_th\">End Date</TD>\r\n    <TD width=\"17%\" align=\"center\" class=\"td_th\">Viewed / Views Allowed</TD>\r\n    <TD width=\"17%\" align=\"center\" class=\"td_th\">Clicked / Clicks Allowed</TD>\r\n    </TR>\r\n ";

Link to comment
Share on other sites

It's a lot easier to read code if it has syntax highlighting and reasonable indentation.

echo "
  


Total Views Allowed:
Unlimited
          
            
            
              Total Clicks  Allowed:
              Unlimited
          
        
   
    
     Smarty Code (Developer)
     {\$ads->getAdCode(1)}
   
    
       
      
    
    



</pre>
<table cellspacing="1" cellpadding="4" width='\"100%\" ' border="0">
  
  
    Ad Campaigns
  
  
     
    ID
    Campaign Name
    Start Date
    End Date
    Viewed / Views Allowed
    Clicked / Clicks Allowed
    
";</

Okay, yeah, so most of it is red. That's good. But there are some parts that are not. Scroll over to see them.

 

They should be.

 

Using characters like "$(" is okay because PHP knows that "(" can't possibly be part of a variable name. However you can't use "{$(" because that opening { tells PHP that the stuff after the dollar sign is most definitely a variable. Except it isn't. So PHP complains.

 

As Jake said: escape the $s.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.