Search the Community
Showing results for tags 'multiple function calls'.
-
Hello all...so I am baffled as to why this is not working and am in desperate search of an answer. My code is attached below. So, I have a site that registers followers once they have entered their info (it is a voluntary registration to a historical society). When they register, an email needs to go out to them (receipt) saying basically 'thanks! you joined!' (email 1), then an email needs to go out to the Historical Society itself notifying them of a new member (john smith) registering (email 2). Finally, an email (number 3) also needs to go out which contains the updated email list of members. I did this by writing 3 different php <?php ... ?> functions, but Dreamweaver is only executing the first mail function. So I thought...must have bugged the second function, so to test it, I switched the order of operations between the first and second function, and now the second function works but now the first function does not. Same holds for the third function if it is first in line. I was under the impression that I could have a thousand different php scripts and they would all be executed, but if I do email 1, email 2 doesn't happen, nor email 3, and vice-versa.for any other permutations. So, if someone knows why this is happening, great, please tell me. Alternatively, if someone knows how to call a php script from a different php script could you tell me that? Because I could divide them into script1.php, script2.php, and script3.php and call them consecutively, which may solve the problem. Every script works...its just that executing the first one seems to be causing the others to not execute, and I cannot figure out why. Thanks in advance. Thanks friends. Patrick`<?php $file = 'EmailList.txt'; // Open the file to get existing content $current = file_get_contents($file); // Append a new person to the file $current .= $_POST['Email'].', '; // Write the contents back to the file file_put_contents($file, $current); ?> <?php //New Member Info Reported to the Third DCA HS require('class.phpmailer.php'); $exp_date = date('m-d-Y', strtotime('+1 year')); $msg1 = 'The following individual has completed the payment process and should be entered into the Historical Society database: '."\r\n"."\r\n"; $msg2 = 'You have successfully registered with the Third District Court of Appeal Historical Society. Please review the information below and contact us at thirddcahs@gmail.com if there are any inaccuracies. We thank you for your support.'."\r\n"."\r\n"; $body = 'First Name: '.$_POST['First_Name']."\r\n".'Last Name: '.$_POST['Last_Name']."\r\n".'Middle Initial: '.$_POST['MI']."\r\n".'Firm/Organization: '.$_POST['Organization']."\r\n".'Position: '.$_POST['Position']."\r\n".'Address: '.$_POST['Address']."\r\n".'Address (cont.): '.$_POST['Address_Cont']."\r\n".'City: '.$_POST['City']."\r\n". 'State: '.$_POST['State']."\r\n".'Zip: '.$_POST['Zip']."\r\n".'Phone: '.$_POST['Phone']."\r\n".'Fax: '.$_POST['Fax']."\r\n".'Email: '.$_POST['Email']."\r\n".'Membership Expiration Date (MM-DD-YYYY): '.$exp_date."\r\n".'Amount Paid: $25.00'; $email = new PHPMailer(); $email->From = 'admin@thirddcahistoricalsociety.org'; $email->FromName = 'The Third District Court of Appeal Historical Society'; $email->Subject = $msg1; $email->Body = $body; $email->AddAddress( 'Patrick.Cesarano@gmail.com' ); //$recipients1 = 'phil@parrishappeals.com, paulappeal@aol.com, caliannel@aol.com, cgeorge@cmpg-law.com, admin@thirddcahistoricalsociety.org, dtownsend@parrishappeals.com'; return $email->Send(); ?> <?php //New Member Info Reported to the Enrolling Member require('class.phpmailer.php'); $exp_date = date('m-d-Y', strtotime('+1 year')); $msg2 = 'You have successfully registered with the Third District Court of Appeal Historical Society. Please review the information below and contact us at thirddcahs@gmail.com if there are any inaccuracies. We thank you for your support.'."\r\n"."\r\n"; $body = 'First Name: '.$_POST['First_Name']."\r\n".'Last Name: '.$_POST['Last_Name']."\r\n".'Middle Initial: '.$_POST['MI']."\r\n".'Firm/Organization: '.$_POST['Organization']."\r\n".'Position: '.$_POST['Position']."\r\n".'Address: '.$_POST['Address']."\r\n".'Address (cont.): '.$_POST['Address_Cont']."\r\n".'City: '.$_POST['City']."\r\n". 'State: '.$_POST['State']."\r\n".'Zip: '.$_POST['Zip']."\r\n".'Phone: '.$_POST['Phone']."\r\n".'Fax: '.$_POST['Fax']."\r\n".'Email: '.$_POST['Email']."\r\n".'Membership Expiration Date (MM-DD-YYYY): '.$exp_date."\r\n".'Amount Paid: $25.00'; $email = new PHPMailer(); $email->From = 'admin@thirddcahistoricalsociety.org'; $email->FromName = 'The Third District Court of Appeal Historical Society'; $email->Subject = $msg2; $email->Body = $body; $email->AddAddress( $_POST['Email'] ); //$recipients1 = 'phil@parrishappeals.com, paulappeal@aol.com, caliannel@aol.com, cgeorge@cmpg-law.com, admin@thirddcahistoricalsociety.org, dtownsend@parrishappeals.com'; return $email->Send(); ?> <?php require_once('class.phpmailer.php'); $email = new PHPMailer(); $email->From = 'admin@thirddcahistoricalsociety.org'; $email->FromName = 'The Third District Court of Appeal Historical Society'; $email->Subject = 'Email List'; $email->Body = 'Here is the most recent email list for the Third Districk Court of Appeal Historical Society'; $email->AddAddress = 'Patrick.Cesarano@gmail.com'; //$email->AddAddress( '...' ); $file_to_attach = 'EmailList.txt'; $email->AddAttachment( $file_to_attach , 'Email List' ); return $email->Send(); ?>`