kersti
09-06-2010, 09:44 AM
Hi
I want to include a random image next to the name on my header and I'm havingtrouble getting it to work.
This is the code I have in the header file
<li><img src="http://www.domain.com/images/icons/smile"<?php $random = rand(1,9); echo $random; ?>".gif" alt="Smile " height="20" width="22" /></li>
But this displays a broken image with the URL
http://www.domain.com/images/icons/smile%3C?php%20$random%20=%20rand(1,9);%20echo%20$ random;%20?%3E.gif
So it's clearly not parsing the php
However, I'm not good at this - can anyone fix my code?
Many many thanks
K
I want to include a random image next to the name on my header and I'm havingtrouble getting it to work.
This is the code I have in the header file
<li><img src="http://www.domain.com/images/icons/smile"<?php $random = rand(1,9); echo $random; ?>".gif" alt="Smile " height="20" width="22" /></li>
But this displays a broken image with the URL
http://www.domain.com/images/icons/smile%3C?php%20$random%20=%20rand(1,9);%20echo%20$ random;%20?%3E.gif
So it's clearly not parsing the php
However, I'm not good at this - can anyone fix my code?
Many many thanks
K