Jump to content

Parse error: syntax error, unexpected '(', expecting T_VARIABLE or '$' in


arunkr

Recommended Posts

{

    $select = "selected='selected'";

}

echo "<option value='0'>AM</option>";

echo "<option value='12' ".$select.">PM</option>";

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 ";

$query = "SELECT * \r\n FROM `ad` ";

Link to comment
Share on other sites

Actually, the error message occurs in the line that starts echo "              </select></td>\r\n  ..., not in the $query = "SELECT * \r\n FROM `ad` "; line. You must have miss counted.

 

Oh, and no one is really going to help you troubleshoot that mess the way it is written, there's no reason for any code to be written that way. Where did you get that code?

 

 

Link to comment
Share on other sites

I can give you a hint. Because someone removed most of the white space from that HTML/Javascript, the parts of it that look like {$...} are being parsed by php as a php variable within a string. However, the leading {'s are actually part of some Javascript if(){}else{} statements and are not part of php's {$...} syntax. Format that HTML/Javscript with some white-space/new-lines so that the Javascript does not look like php syntax and the php parser errors will be fixed.

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.