Page 1 of 1

Newbie's problem with PHP syntax

Posted: Sun May 31, 2009 4:39 pm
by apples
Hi, I have to do this assignment for class, and was having problems.
Everything was working fine.
But when I entered a line, the page started becoming blank.
When I took the line off again everything was fine.
I checked the syntax on some website, and it points out this line also.
So here is that line:


<?php if($num_correct['xhtml']>0 {echo "correct";}
if($incorrect['xhtml']>0) {echo "incorrect";}
?>


This was actually given by my professor. I personally think this is kind of cheesy. I'd use a if else function.
But this is the way he wants it.


So can somebody help me out please.


I made a quiz. and at the end i put this for each question. and tells whether teh person answered it correctly or not


thanks a lot.

Re: Newbie's problem with PHP syntax

Posted: Sun May 31, 2009 4:47 pm
by requinix
The first line is missing a closing parenthesis.

Re: Newbie's problem with PHP syntax

Posted: Sun May 31, 2009 4:52 pm
by apples
Oh my God. I spent 5 hours doing I don't know what.
And i was missing a closing parenthesis.
Mother.



Thanks a lot man. You saved another 5 hours.