Forum Moderators: coopster

Message Too Old, No Replies

Unexpected T string error

         

adamcap

2:47 pm on May 29, 2010 (gmt 0)

10+ Year Member



Hey everyone!

Hopefully someone can help me out with this...

I am editing my WordPress header.php file and trying to add this code:

<form style="border:1px solid #ccc;padding:3px;text-align:center;" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=sixprizes', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><p>Enter your email address:</p><p><input type="text" style="width:140px" name="email"/></p><input type="hidden" value="sixprizes" name="uri"/><input type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" /></form>

As soon as I add it however, I get the dreaded unexpected T_string error.

What is causing the error here?

Thanks for any help...I'm not very good with troubleshooting these types of issues.

Best,

Adam

Readie

2:58 pm on May 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You have both single and double quotes in that string, and I assume you're using echo (or print) rather than dropping out of PHP.

If you are echoing within single quotes, you must escape any single quotes you use:

echo 'Foo "I\'m" Bar';

Or double quotes:

echo "<a href=\"index.php\">'Foo'</a>";

adamcap

5:29 pm on May 29, 2010 (gmt 0)

10+ Year Member



Thanks so much Readie! Escaping single quotes did the trick. :)