[SOLVED] Sending Mail Using IF and ELSEIF

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
Harlequin
Forum Commoner
Posts: 51
Joined: Tue Sep 21, 2004 10:51 am
Location: UK

Sending Mail Using IF and ELSEIF

Post 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...?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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]
Harlequin
Forum Commoner
Posts: 51
Joined: Tue Sep 21, 2004 10:51 am
Location: UK

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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...
Harlequin
Forum Commoner
Posts: 51
Joined: Tue Sep 21, 2004 10:51 am
Location: UK

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm not Jason ;)
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Thats really odd. I wonder why you thought feyd was Jason...
Harlequin
Forum Commoner
Posts: 51
Joined: Tue Sep 21, 2004 10:51 am
Location: UK

Post 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)
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post 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.
Harlequin
Forum Commoner
Posts: 51
Joined: Tue Sep 21, 2004 10:51 am
Location: UK

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