Jump to content

radio button to choose email message


Recommended Posts

 
<?php 
if (isset($_POST['submit'])) 
{ 
$user=""; 
$host="localhost"; 
$password=""; 
$database=""; 
$connection = mysql_connect($host,$user,$password) or die ("could not connect to server"); 
$db = mysql_select_db($database,$connection); 
$sql = "insert into membershipdb(name, address1, address2, address3, pcode, email, website, daynum, evenum, faxnum, audio, video, lighting, computers, avdesign, internetpublishing, projectsystems, webcasting, tvbroadcasting, musicproduction, liveproduction, membership) values ('{$_POST['name']}','{$_POST['address1']}','{$_POST['address2']}','{$_POST['address3']}','{$_POST['pcode']}','{$_POST['email']}','{$_POST['daynum']}','{$_POST['website']}','{$_POST['evenum']}','{$_POST['faxnum']}','{$_POST['audio']}','{$_POST['video']}','{$_POST['lighting']}','{$_POST['computers']}','{$_POST['avdesign']}','{$_POST['internetpublishing']}','{$_POST['projectsystems']}','{$_POST['webcasting']}','{$_POST['tvbroadcasting']}','{$_POST['musicproduction']}','{$_POST['liveproduction']}','{$_POST['membership']}')"; 
$result = mysql_query($sql) or print(mysql_error()); 
if (!empty($_POST['CMS'])){ 
$mail = new MyMailer; 
$mail->AddAddress($_POST['email']); 
$mail->Subject = "Thank you for filling out our form"; 
$mail->Body    = 'Hello '.$_POST['lname'].', Thank you for filing out this form . you have selected the College Student Membership. This link will take you to paypal site where you can pay for your membership. \n\n<p>https://www.paypal.com/xclick/business=peterodetunde%40hotmail.com&item_name=College+Student+Membership&item_number=CSM/GMN04&amount=15.00&no_note=1&currency_code=GBP&lc=GB'; 
exit; 
} 
if (!empty($_POST['CMS']) || !empty($_POST['IPM']) || !empty($_POST['IM']) || !empty($_POST['SM']) || !empty($_POST['GM']) || !empty($_POST['PM']) || !empty($_POST['BGM']) || !empty($_POST['PCM'])) 
{ 
   echo "<span class='biggertext'>"; 
   echo "Please return back to the form and choose your membership"; 
   echo "</span>"; 
   echo "<form>"; 
   echo "<input type='button' value='Go Back' onclick='history.back(-1)' class='textstyle'>"; 
   echo "</form>"; 
   exit; 
} 
echo "<table class=textstyle1white><tr><td>"; 
echo 'Hello '.$_POST['name'].', Thank you for your filling out this membership form. <p>A confirmation email is on its way to you with more details regarding your membership choice and price.<p><p>Regards, <br>Gospel Media network'; 
echo "<table class=textstyle1white><tr><td>"; 
echo "</tr></td></table>"; 
echo "<body onLoad=redirect() text=#000000 link=#00FFFF vlink=#C0C0C0>"; 
} 
else { 
?> 
<body leftmargin="0" topmargin="0" bgcolor="transparent">//this is where the html table starts....... 
//........ 
</body> 
<? 
} 
?>  

 

this is the code for the radio button. what i want is to be able to select which email i send depending on the radio button. each button is connected to a price so the the radio button for a particular price needs to access the email that has the same price in the email. hope this is clear. should the 'exit;' at the end be there or is there something else?

 

Link to comment
https://forums.phpfreaks.com/topic/2055-radio-button-to-choose-email-message/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.