Sorry guys, another problem tonight, I'm missing ASP already, it just appears to be more logical in terms of syntax!!!

Here goes...

if (!empty($TheEmail) && !empty($ThePassword) && !empty(TheSecurityToken)) {

For some reason, my page is halting at this line, and giving me this error...

Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in ...\Website Root\login.php on line 15

I've researched this error...and found very little in terms of the cause, I presume I'm structing my 'if' statement incorrectly?

    Ahhh, I appear to have just solved it myself...

    if (!empty($TheEmail) && !empty($ThePassword) && !empty($
    TheSecurityToken)) {

      You'll soon love the php syntax much more than that foul mess that is ASP. It's like learning C when you've had the horrors of Pascal and VB. Braces are nice and symmetrical and graphically hold things. You're lucky you're not learning Perl.

        Drakla;10878822 wrote:

        You'll soon love the php syntax much more than that foul mess that is ASP. It's like learning C when you've had the horrors of Pascal and VB. Braces are nice and symmetrical and graphically hold things. You're lucky you're not learning Perl.

        LOL, I'll give it some more time then - I have to admit that my Javascript abilities have always been a little poor, I've already noticed an improvement in my ability to write Javascript without having to refer now, PHP and Javascript appear to follow almost identical syntax and operators.

        I guess the only thing I can't yet get my head around is the difference between =, == and === when comparing variables!?!

        Cheers, Ash

          ashleyhall wrote:

          I guess the only thing I can't yet get my head around is the difference between =, == and === when comparing variables!?!

          Well, the last 2 you'll find here: [man]language.operators.comparison[/man]. The first, '=', isn't used in comparing at all - it's the assignment operator ([man]language.operators.assignment[/man]).

          As for the difference between '==' and '===', the manual spells it out - the latter of the two compares not only the value but also the type. Since PHP is a loosely-typed language, '0' == FALSE (that is, a string containing a single character, a zero, equals the boolean value FALSE), whereas the same statement would be false if you used '===' (string vs. boolean, type mismatch).

            Thanks again for your help mate, I'm growing to like PHP already...I think!

              No problem; don't forget to mark this thread resolved (if it is).

                Write a Reply...