En cours

PHP quiz not displaying special characters correctly

This is a simple problem for anyone experienced with HTML and PHP.

I have a quiz written in PHP which appears on my wordpress blog. The quiz is designed to test a user’s knowledge of javascript. Unfortunately the questions contain javascript code (special characters) and this creates a conflict with the HTML or PHP and they do not appear correctly on the results page after session state is used to retrieve the users answers.

Quiz is here: [url removed, login to view]

I tried adding the htmlspecialchars method but this only solved some of the problems

For example the following question does not display correctly:

-------------------------------------

$question6 = htmlspecialchars("This question is related about arrays in javascript. Which one of the follwing is the correct way to initialize an array? ");

$question6_option1 = htmlspecialchars("var student=new Array(); myCars[0]=\"Joe\"; ");

$question6_option2 = htmlspecialchars("var myCars=new Array(\"Joe\",\"Chris\",\"Martyn\"); ");

$question6_option3 = htmlspecialchars("var myCars=[\"Joe\",\"Chris\",\"Martyn\"]; ");

$question6_correct_answer = htmlspecialchars("All of the above are correct ");

$_SESSION['question6'] = $question6;

----------------------------------------

This problem should not take long to fix. I also require the problem fixed in 24 hours.

PLEASE TAKE A LOOK AT THE WORD DOCUMENT TO SEE HOW THE QUESTIONS SHOULD APPEAR

I am planning to create more than one quiz which will test a users knowledge of PHP, C#, C.Net, HTML etc. Therefore I need the quiz to support all special characters and display them correctly without having to work out how to type them in.

Compétences : HTML, PHP, WordPress

Voir plus : php quiz displaying special characters correctly, display special characters php quiz, user tests, session php, session 13, how to take tests, wordpress quiz, take tests, s joe, quiz, quiz questions, quiz question, new characters, joe, Arrays, answers php, simple javascript html quiz, php test page, php special, javascript array com, wordpress display php page, wordpress conflict, knowledge question, question quiz php, simple quiz html javascript

Concernant l'employeur :
( 7 commentaires ) Lostwithiel, United Kingdom

N° du projet : #1082715

Décerné à :

stuntrider

I'm definitely your guy for this one...please see my private message, thanks!

30 $ USD en 1 jour
(16 Commentaires)
4.8

9 freelance ont fait une offre moyenne de 34 $ pour ce travail

ichurakov

Ready to fix

30 $ USD en 0 jours
(248 Commentaires)
6.4
dracco

see your pmb please

30 $ USD en 0 jours
(151 Commentaires)
5.9
PHPsoldier

HI, I CAN FIX IT QUICKLY. THANKS....

30 $ USD en 1 jour
(51 Commentaires)
5.7
muhammadghasan

hi, Please Check your PMb, thanks

50 $ USD en 1 jour
(28 Commentaires)
5.4
bdlancer09

Should be an easy fix for me.

30 $ USD en 1 jour
(51 Commentaires)
4.7
MoonLightCdr

I can do this quickly

30 $ USD en 1 jour
(6 Commentaires)
3.6
jagannathbehera

I can solved it.

30 $ USD en 1 jour
(5 Commentaires)
3.3
sunwayjiao

I can do [url removed, login to view] contact me

30 $ USD en 0 jours
(0 Commentaires)
0.0
tejsols

can do this.

50 $ USD en 1 jour
(0 Commentaires)
0.0