[FX.php List] Web compatibility of Scripts in FM7
Michael Layne
fx at 9degrees.com
Thu May 12 13:35:42 MDT 2005
Jane,
Don't need a script... it's the same with the PHP mail() function for
FM as MySQL. after your FMNew(), just have a variable grab those
results and format as you have on your email...
// the reply page...
$query->AddDBParam('user',$_POST['user']);
$query->AddDBParam('email',$_POST['email']);
$result = $query->FMNew();
$data = current($result['data']);
$to = $data['email'][0]; // or $_POST['email'];
.....
.....
mail($to, $subject, $message, $headers);
make sense?
HTH,
Michael
On May 10, 2005, at 2:33 PM, Jane Chinn wrote:
>
> Hello,
>
> I have been trying to trigger a script that sends an email in FM7
> when a new record is created via a web form. I see now that the
> script to send mail in FM7 is not compatible with the web. This is
> indicted in the create new script window. On the far left is a
> check box that says, "indicate web compatibility". If you place a
> check mark there you will see that the send mail script option is
> grayed out. I have been able to perform scripts with FX.php though
> that are compatible, including sorts and finds that take place in
> the database.
>
> Can someone send me a chunk of code for sending an email when a new
> record is created. It would be nice to simply add the code to the
> reply page that carries out the new record action. I have done
> this with PHP and mysql in the past as follows:
>
> <?
> $subject = "Writing Center Request";
> $to = "uwc at cwu.edu\r\n";
> $headers = "From: $email\r\n";
> $headers .= "MIME-Version: 1.0\r\n";
> $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
> $headers .= "Cc: chinn at cwu.edu\r\n";
>
>
> $message ="The following individual has submitted a Writing Center
> request:<br />
> $FirstLast<br />
> CWU Student ID $StudentID <br /> Course - $course<br />
> EMail: $email <br />
> Instructor: $instructor_last <br />
> Due Date: $due_date<br />
> Year in School: $year_in_school<br />
> Title of Paper: $paper_title<br />
> Question: $Question<br />
> Body of Paper: $Paper";
>
> mail($to,$subject,$message,$headers);
>
> ?>
>
> Any suggestions on how to adapt this to FX.php?
>
> Thanks
> Jane Chinn
> Instructional Technologies Specialist
> Central Washington University
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
More information about the FX.php_List
mailing list