I need some help, I have a flash program with the php file sendmail...
<?
if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_subject']) || !empty($HTTP_POST_VARS['sender_name']))
{
$to = "me@me.com";
$subject = "Submitted from the SCL website / SCL mailing List";
$body = stripslashes($HTTP_POST_VARS['sender_message']);
$body .= "I would like to be added to the monthly SCL mailing list for legal tips and tricks. Please add my email address to your list.";
$body .= " My email address is: " . $HTTP_POST_VARS['sender_name'] . " " . $HTTP_POST_VARS['sender_mail'] . "";
$header = "From: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "Reply-To: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "X-Mailer: PHP/" . phpversion() . "\n";
$header .= "X-Priority: 1";
if(@mail($to, $subject, $body, $header))
{
echo "output=sent";
} else {
echo "output=error";
}
} else {
echo "output=error";
}
?>
This code works great...however, the email gets filtered out by Verizon, so I would like to instead, submit this info to a file in my private directory...like I do on the html pages _private/form_results.txt -- I would rather not change any of the flash script which calls sendmail.php...
I am a php newbie...this is what I came up with...any help would be greatlly appreciated...
This doesn't work....
Flash calls sendmail.php...we know that works...this is my new sendmail...based on the post variable from the previous sendmail
<?php
$email=$HTTP_POST_VARS['sender_mail'];
$fp = fopen("_private/forms_result.txt","a");
if(!$fp) {
print "error! The file could not be opened";
exit;
}
$stringtowrite=$email
fwrite($fp, $stringtowrite);
fclose($fp);
?>
:bemused: