davidcriniti Posted September 16, 2009 Share Posted September 16, 2009 Hi there, I've developed a template to make multiple choice quizzes for the students at my school. They fill out a form on a html page. Upon submit, feedback is provided. For example, with question 1 ( $q001 ) as a variable, I've made php code like this: $q001 = $_POST["q001"]; <?php if ($q001=="right") echo "Well done"; ?> My question is this. How would I go about inserting an image ( tick.gif ) rather than saying "Well done"? Any help would be much appreciated. Dave Quote Link to comment Share on other sites More sharing options...
Bricktop Posted September 16, 2009 Share Posted September 16, 2009 Hi Dave, Just use something like: <?php if ($q001=="right") echo "<img src="images/tick.jpg" alt="Correct" /> "; ?> Quote Link to comment Share on other sites More sharing options...
Michdd Posted September 16, 2009 Share Posted September 16, 2009 Hi Dave, Just use something like: <?php if ($q001=="right") echo "<img src="images/tick.jpg" alt="Correct" /> "; ?> That'll give a syntax error. if($q001 == "right") echo '<img src="tick.gif" alt="Correct" />'; Quote Link to comment Share on other sites More sharing options...
davidcriniti Posted September 16, 2009 Author Share Posted September 16, 2009 Thanks for your time Bricktop and Michdd! It's now working great! Dave Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.