Newbie's problem with PHP syntax

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
apples
Forum Newbie
Posts: 6
Joined: Sun May 31, 2009 4:35 pm

Newbie's problem with PHP syntax

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Newbie's problem with PHP syntax

Post by requinix »

The first line is missing a closing parenthesis.
apples
Forum Newbie
Posts: 6
Joined: Sun May 31, 2009 4:35 pm

Re: Newbie's problem with PHP syntax

Post 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.
Post Reply