Parse error: syntax error, unexpected T_BAD_CHARACTER, expecting T_STRING or T_VARIAB

Discussion in 'PHP' started by cyclebids, Apr 30, 2007.

  1. #1
    says on line 80 line 80 is the line with AC_AX_RunContent

    very new to php any help very much apreciated



    if ($ext == 'swf')
    		  {
    			  $show['main']['fileshow'] = "<script type='text/javascript'>
    AC_AX_RunContent( 'width','480','height','480','src','\'.$config[\'siteurl\'].\'/files/\'.$show[\'main\'][\'file\'].\'','animation','file' ); //end AC code
    </script><noscript><object width="480" height="480"><param name="animation" value="file"><embed src= "'.$config['siteurl'].'/files/'.$show['main']['file'].'" width="480" height="480"></embed></object></noscript>";
    			  $show['main']['filenote'] = 'Note: You Need <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Macromedia Flash Player</a> to view this file!';
    		  }
    PHP:
     
    cyclebids, Apr 30, 2007 IP
  2. JPRuss

    JPRuss Peon

    Messages:
    119
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your quotes are confusing me a little but I think the basic problem is that the character "\" is an escape character, so anything after it is treated as a literal.

    ie '\' would escape the quote ' which means you would need another quote to close the quote.

    What I usually do is break my string down into smaller strings to try and debug.

    So for example instead of the text

    '\'.$config[\'siteurl\'].\'/files/\'.$show[\'main\'][\'file\'].\''

    try something like

    $TheStr = $config['siteurl'] . '/files/' . $show['main']['file'];

    AC_AX_RunContent( 'width','480','height','480','src','" . $TheStr . "' etc.
     
    JPRuss, Apr 30, 2007 IP
  3. cyclebids

    cyclebids Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    so i tried this now i get this lin 81 is </script><noscript> line

    if ($ext == 'swf')
    		  {
    			  $show['main']['fileshow'] = "<script type='text/javascript'>
    AC_AX_RunContent( 'width','480','height','480','src','".$config['siteurl']."/files/".$show['main']['file']."','animation','file' ); //end AC code
    </script><noscript><object width="480" height="480"><param name="animation" value="file"><embed src= ".$config['siteurl']."/files/".$show['main']['file']." width="480" height="480"></embed></object></noscript>";
    			  $show['main']['filenote'] = 'Note: You Need <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Macromedia Flash Player</a> to view this file!';
    		  }
    PHP:
     
    cyclebids, Apr 30, 2007 IP
  4. cyclebids

    cyclebids Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    so know one can help me please im desperate here.

    someone please help?
     
    cyclebids, Apr 30, 2007 IP
  5. Subikar

    Subikar Active Member

    Messages:
    241
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #5
    
    if ($ext == 'swf')
              {
                  $show['main']['fileshow'] = "<script type='text/javascript'>
    AC_AX_RunContent( 'width','480','height','480','src','".$config['siteurl']."/files/".$show['main']['file']."','animation','file' ); //end AC code
    </script><noscript><object width='480' height='480'><param name='animation' value='file'><embed src= '".$config['siteurl']."/files/".$show['main']['file']."' width='480' height='480'></embed></object></noscript>";
                  $show['main']['filenote'] = 'Note: You Need <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Macromedia Flash Player</a> to view this file!';
              }
    
    PHP:

    Now it is corrected use this one. :)
     
    Subikar, Apr 30, 2007 IP
  6. cyclebids

    cyclebids Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6


    Thanks you it worked perfect. Much apreciated.
     
    cyclebids, May 1, 2007 IP