Parse error: syntax error, unexpected T_DNUMBER
May 8th, 2007I was working on a site for someone trying to find out why the page was displaying this error ‘Parse error: syntax error, unexpected T_DNUMBER’.
After looking up a number of different references on Google and still not finding an answer that would point to an easy solution, I spent an hour going through line by line of code trying to find the problem.
Finally, I found that the eval() function for PHP was trying to display a template with variables but was generating this error and stop the page from displaying.
So I found that the problem lied in a variable that was being set had a ton of html in it and there were two quotation marks that were not being escaped.
Here is the problem code:
<DIV CLASS=googleadsovergame>
<script language=\"JavaScript\">
<!--
ctxt_ad_partner = "9999999999";
ctxt_ad_section = "99999";
Here is the fixed code:
<DIV CLASS=googleadsovergame>
<script language=\"JavaScript\">
<!--
ctxt_ad_partner = \"9999999999\";
ctxt_ad_section = \"99999\";
It was a simple fix really, but a problem that I have found is that there were no comments in the code to make it easy to find my way through the number of pages and functions until I got to the problem.
I hope that this helps you find your problem with this error!
So remember, comment your code as much as possible, those who come after you will thank you for it!
3 Comments
Comments RSS TrackBack Identifier URI
Leave a comment






I got the same error but solved very quickly thanks to your posting.
Thank you so much!!
Thanks man, you saved me a lot of time!
hey thanks a lot!!
was getting the same error….fixed with your help
Thanks