Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

Hii guys. REALLY NEED UR HELP on my php programming. just wanted to ask what's wrong with my code that everytime i view it on google chrome, it displays '0 points', it should display '5 points' because its he/she has chosen all 3 answers

OpenStudy (anonymous):

<html> <body> <?php $score1=0; $ques1 = $_POST['ques1']; $x=count($ques1); if($x!=3) {echo "1. You can only/have to check 3 boxes.&nbsp &nbsp";} else { foreach($ques1 as $x) {echo"$x";} if($x=="A" && $x=="C" && $x=="E") { $score1=$score1+5; } if ($x=="B" OR $x=="D") {echo "&nbsp 1. Wrong &nbsp &nbsp"; $score1=$score1-5;} } echo"&nbsp 1. You have $score1 points.<br><br>"; ?> </body> </html>

OpenStudy (rsmith6559):

if($x=="A" && $x=="C" && $x=="E") is a real fussy line of code. Your logic, although I don't know PHP, looks OK. I would guess that you're having a problem related to character encoding, say UTF-16 with an ASCII comparison.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
20 hours ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
23 hours ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!