Forum Moderators: coopster

Message Too Old, No Replies

What am I doing wrong? adding image in php?

         

tresmom5

1:26 am on Sep 28, 2004 (gmt 0)

10+ Year Member



I really wanted to figure this out on my own, but have spent two hours messing around with this stupid little thing and can't figure it out. This syntax stuff is making me insane.

Ok, here is what I am doing. I am making an online quiz. I figured simple enough. Right? Here is what I have that is messing me up

if ($score > 49) {
echo "$score % chance ";
}

Ok after it says chance I want to add an image and for the life of me I can't figure out how to do it. I keep getting parsing errors every time. Can someone help me? How do I add an image to this? I basically want different images to show up for different scores. This really should be simple.

Thanks,
Teresa

Timotheos

3:10 am on Sep 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your problem is most likely that you're not escaping the double quotes in the html tags.

if ($score > 49) {
echo "$score % chance <img src=\"image.jpg\">";
}

tresmom5

3:39 am on Sep 28, 2004 (gmt 0)

10+ Year Member



Yep, I had my quotes in the wrong place. Thanks so much.

Teresa