Jump to content


Photo

radio button to choose email message


  • Please log in to reply
No replies to this topic

#1 buzzby

buzzby
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 16 November 2004 - 12:07 PM

<?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?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users