Hi,
I'd like to remeber you, to make things more easy, PHP script can be separted inside the file by ordinary HTML tags and all will go fine, look for this example
<?
for ($i = 1; $i <= 10; ++$i):
?>
<b>Hello variable No</b> <?=$i?>
<?
endfor;
?>
this will give print out as:
Hello variable No 1
Hello variable No 2
Hello variable No 3
Hello variable No 4
......
Hello variable No 10.
By applying this, it will be so easy to deal with HTML elements inside your script without in difficulties with ' or " or echo, etc
I hope this offer a help