Jump to content

Display image in PHP quiz results


ellamorten

Recommended Posts

Hi,

 

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:

 

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

$title="Quiz: ---";
$types="5";
$questions="16";

$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

Link to comment
https://forums.phpfreaks.com/topic/239368-display-image-in-php-quiz-results/
Share on other sites

Surely it's not this simple?

 

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

$title="Quiz: ---";
$types="5";
$questions="16";

$type[0] = "<img src=\"images/type0.jpg\" /><p>If you answer mostly As...</p>";
$type[1] = "<img src=\"images/type1.jpg\" /><p>If you answer mostly Bs...</p>";
$type[2] = "<img src=\"images/type2.jpg\" /><p>If you answer mostly Cs...</p>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.