ellamorten Posted June 14, 2011 Share Posted June 14, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/239368-display-image-in-php-quiz-results/ Share on other sites More sharing options...
redixx Posted June 14, 2011 Share Posted June 14, 2011 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>"; Quote Link to comment https://forums.phpfreaks.com/topic/239368-display-image-in-php-quiz-results/#findComment-1229717 Share on other sites More sharing options...
ellamorten Posted June 14, 2011 Author Share Posted June 14, 2011 No, that doesn't work. I get the following error: "Parse error: syntax error, unexpected T_STRING in /public_html/quiz/quiz.qz on line 16" Quote Link to comment https://forums.phpfreaks.com/topic/239368-display-image-in-php-quiz-results/#findComment-1229719 Share on other sites More sharing options...
redixx Posted June 14, 2011 Share Posted June 14, 2011 No, that doesn't work. I get the following error: "Parse error: syntax error, unexpected T_STRING in /public_html/quiz/quiz.qz on line 16" Whoops. Updated my post. Quote Link to comment https://forums.phpfreaks.com/topic/239368-display-image-in-php-quiz-results/#findComment-1229721 Share on other sites More sharing options...
ellamorten Posted June 14, 2011 Author Share Posted June 14, 2011 Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/239368-display-image-in-php-quiz-results/#findComment-1229724 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.