Click to See Complete Forum and Search --> : Printing in PHP - speechmark errors


nickisme
06-20-2006, 03:39 AM
This is a really silly one, but I'm getting stuck - can anyone point out the mistake?

I have the following code:


print "<class=\"navItem_$num_commas\"><img src=\"images/folder_closed.gif\"><a href=\"#\" onclick=\"amend($idL2,'Side')\">$TitleL2</a></class>";


which should print out something like:


<class="navItem_0"><img src="images/folder_closed.gif"><a href="#" onclick="amend(2,'Side')">Home</a></class>


It doesn't however... it prints the same, but when closing the class tag, it prints </class="navItem_0"> - eg:


<class="navItem_0"><img src="images/folder_closed.gif"><a href="#" onclick="amend(2,'Side')">Home</a></class="navItem_0">


And thus the class doesn't seem to actually work in any way (ie it doesn't refer to the file's CSS). What's going wrong?

Thanks again!

bathurst_guy
06-20-2006, 03:41 AM
Doesn't make sense - was the code above copied and pasted?

nickisme
06-20-2006, 03:44 AM
Yeah, it was the source code as shown in FF. Don't know if this makes a difference, but it's using AJAX - this code is returned from the server... still can't think why that would make any change though...