the-sexy-slug Posted August 3, 2010 Share Posted August 3, 2010 Hello I am trying to post a javascript code an example would be adsense into a php script and all I am getting is this error:- Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/usermane/public_html/webaddress.co.uk/test/test.php on line 2 This is my very simple script: <?php echo "<script language="JavaScript" src=""></script>"; ?> I have not posted the full script as it is a affiliate link script. Thanks in advance Quote Link to comment Share on other sites More sharing options...
KevinM1 Posted August 3, 2010 Share Posted August 3, 2010 Hello I am trying to post a javascript code an example would be adsense into a php script and all I am getting is this error:- Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/usermane/public_html/webaddress.co.uk/test/test.php on line 2 This is my very simple script: <?php echo "<script language="JavaScript" src=""></script>"; ?> I have not posted the full script as it is a affiliate link script. Thanks in advance The problem is with your quotes. You can't use double quotes to both denote a string and have double quoted text within the string. You need to do one of two things: 1. Mix in single quotes 2. Escape the double quotes within the string So... 1. echo '<script language="Javascript" src=""></script>'; 2. echo "<script language=\"Javascript\" src=\"\"></script>"; Quote Link to comment Share on other sites More sharing options...
the-sexy-slug Posted August 3, 2010 Author Share Posted August 3, 2010 Nightslyr you are a saint Thank you for your kind help. Option 1 worked a treat Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.