debuitls Posted September 10, 2009 Share Posted September 10, 2009 Hello all, I'm having a small problem, I think its a syntax error. echo "You may book this"."<a href="#" onclick="openbox('E-mail directly', 1)">here</a>" Can anyone spot the problem with the above? Any suggestions would be appreciated? Quote Link to comment https://forums.phpfreaks.com/topic/173823-small-syntax-error-i-think/ Share on other sites More sharing options...
mikesta707 Posted September 10, 2009 Share Posted September 10, 2009 your use of quotation marks is wrong, and its terminating the string prematurely echo "You may book this"."<a href=\"#\" onclick=\"openbox('E-mail directly', 1)\">here</a>"; you want to escape your quotation marks that are inside the string. alternatively you can use single quotes, but I prefer to escape my doule quotes. its all personal preference really Quote Link to comment https://forums.phpfreaks.com/topic/173823-small-syntax-error-i-think/#findComment-916245 Share on other sites More sharing options...
Cory94bailly Posted September 10, 2009 Share Posted September 10, 2009 echo "You may book this"."<a href=\"#\" onclick=\"openbox('E-mail directly', 1)\">here</a>"; You need to escape the quotations or it thinks you are ending/re-starting the echo (Also, you didn't put a semi-colon. EDIT: Damn, mikesta707 beat me Quote Link to comment https://forums.phpfreaks.com/topic/173823-small-syntax-error-i-think/#findComment-916247 Share on other sites More sharing options...
debuitls Posted September 10, 2009 Author Share Posted September 10, 2009 Thanks very much mike, That did the trick. Quote Link to comment https://forums.phpfreaks.com/topic/173823-small-syntax-error-i-think/#findComment-916250 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.