Page 1 of 1

Sending Mail Using IF and ELSEIF

Posted: Tue Sep 21, 2004 10:53 am
by Harlequin
I dunno why but my ELSEIFstatements arn't working - they're broken...!

If I use:

if ($AreasOfInterest01 == $VacancyCategory)
{
Send e-mail
}

It works fine. But If I add:

elseif ($AreasOfInterest02 == $VacancyCategory)
{
Send e-mail
}

It doesn't work if the entry is in AreasofInterest02.

I can declare and echo these variables fine so I know the strings are there but the code simply refuses to execute - and no errors...!

Any ideas guys...?

Posted: Tue Sep 21, 2004 10:56 am
by feyd
post more code.

...and please use

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url]

Posted: Tue Sep 21, 2004 11:01 am
by Harlequin
Sorry. It's just that the code itself is quite lengthy indeed and I didn't want to hack people off by posting a load of code.

Posted: Tue Sep 21, 2004 11:04 am
by feyd
I need to see how the variables are set, and the code that leads up to them.. otherwise, I'm just going to make stabs in the dark as to a solution...

Posted: Tue Sep 21, 2004 11:31 am
by Harlequin
No problem. Thanks very much for your time on this Jason.

I spent some time revisiting my code and found that although I was using a "WHILE" statement I had neglected to place the closing brace outside the IF statements.

This solved the problem.

Jason - Sorry to have wasted your time and thanks very much.

Posted: Tue Sep 21, 2004 11:40 am
by feyd
I'm not Jason ;)

Posted: Tue Sep 21, 2004 1:11 pm
by Joe
Thats really odd. I wonder why you thought feyd was Jason...

Posted: Tue Sep 21, 2004 1:13 pm
by Harlequin
:? I dunno :?

Maybe because the e-mail notification came from: jason@phpcomplete.com

8) I'm only a simple programmer - and a newbie at that 8)

Posted: Tue Sep 21, 2004 1:29 pm
by Joe
hehe, I see. Im sure feyd's name is Jon. I read it somewhere in these forums...

Jason is the head admin at devnetwork.

Posted: Tue Sep 21, 2004 1:32 pm
by Harlequin
Well - I managed to solve my little problem but I'm pleased to find a forum where you don't get flamed for making a simple mistake.

Thanks guys 8)