Display image in PHP quiz results

images php coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Tue Jun 14, 2011 12:44 pm

Display image in PHP quiz results

Postby ellamorten » Tue Jun 14, 2011 12:57 pm


I have a multiple choice quiz made up of a number of files:
- quiz.html - all the questions
- quiz.qz - the file containing all the php code (including the results)
- quizresults.php - the file that calculates & shows the results
- styles.css

I'm having trouble showing an image in the results. The code is as follows:

Code: Select all

echo '<head>';
echo ' <link rel="stylesheet" href="styles.css" type="text/css">';
echo '</head>';

$title="Quiz: ---";

$type[0] = "<p>If you answer mostly As...</p>";
$type[1] = "<p>If you answer mostly Bs...</p>";
$type[2] = "<p>If you answer mostly Cs...</p>";

I was wondering how I could embed a .jpg after each $type so that an image appears before the description in the results...

Thank you

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 2 guests