Link to home
Start Free TrialLog in
Avatar of Jorge Batres
Jorge BatresFlag for United States of America

asked on

if elseif PHP Script problem

Hi, I have a script to email hotel reservation requests. There are several hotels that share the same values and most of them use a general request email form I will call hotel-request. A few hotels have somewhat different values that do not conform to the standard / regular form hotel-request, so I have to include separate email forms for them like, hotel-one, hotel-two and so on. My problem is that if I want to request a hotel with a specific name like hotel-one, the script is sending both form emails (hotel-request and hotel-one) Could you please help me correct this?

Here is part of the script:

case "reservation_request":
				
				        
                        include_once(LEVEL."inc/emailer/emailer.php");
						
                        if($_POST["form_type"] == "hotel-one"){
                                SendEmail("hotel-one-request", $_POST);
                        }
						
						
						elseif($_POST["form_type"] == "hotel-two"){
                                SendEmail("hotel-two-request", $_POST);
                        }
						
						elseif($_POST["form_type"] == "hotel-three"){
                                SendEmail("hotel-three-request", $_POST);
                        }
						
						
						elseif($_POST["form_type"] == "hotel-four"){
                                SendEmail("hotel-four-request", $_POST);
                        }
	
		
						
                        else {
                                SendEmail("hotel-request",$_POST);
								
                        }

Open in new window




Thanks,

Jorge
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jorge Batres

ASKER

Thank you Chris! inadvertently I deleted the "break" line from the script.

Thanks again,

Jorge
Haha - been there ... done that :)