Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail a form to 2 addresses based on button push?

Status
Not open for further replies.

aich69

Technical User
Apr 23, 2004
588
GB
I'm asking this 'on behalf of' so please bare with me as I'm a sys admin not a PHP person..

A collleague has a booking form on a hotel chain website, written in PHP.
The form does the usual 'submit' function sending the form to the central booking dept. However, he would also like it to send a separate mail to the MD of the hotel that the user has checked on the form, on the form there is a choice of several hotels within the chain.

Is this possible? If so how does he go forwards from here?

Apologies for the vagueness (if it is).

Thanks in advance.

Cpt. Red Bull
 
you can't cause a browser to send the same form to two different addresses through a normal route.

you could use javascript to do so (with ajax).

but you don't have to. there is no reason why you cannot do two things with php

Code:
<?php
if (isset($_POST['submit'])){
  processFormToCBD();
  processFormToSendMail();
}
function processFormToCDB(){
  //do something here
}
function processFormToSendMail(){
  //send mail here.
}
?>
 
thanks... I'm going to whizz this code up the stairs and see if it means anything to the guy concerned... I understand the principle but he'll understand the code.

Cpt. Red Bull
 
I guess I should get the chap himself to explain, but....

could you possibly elaborate on the code you posted? Or am I asking a question you can't really answer based on the quality the infoI'm providing? Please excuse my ignorance on this coding matter.

Cheers


Cpt. Red Bull
 
ummmmm, i'm not sure i can help more. if the chap has any knowledge of php my post should be all the answer he needs. If not, then i would need more information as to what it is (i) that you are trying to achieve; and (ii) with which you are having troubles.
 
I thought that might be the case... I'm not sure how much he knows or whether, like me, he picks up free scripts etc from the net to do a job as and when needed as opposed to purpose writing them.
I have passed on the code from your post and will leve him to go figure.

Thanks again.

Cpt. Red Bull
 
tell you what: we always welcome more members. tell him to become a member and introduce himself. we seldom bite.
 
.... I've just suggested he do that as it goes.... I'm sure he can explain things a lot better than I can...

Cpt. Red Bull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top