Hi All,
I am very new to php and I have created this mail php file which works and was wondering if there was an easy way for it, to not only send me an email but to write the same information that is being sent to my email to a txt file located in the same directory as the php file? Thanks in advanced,
BC
<?php
// read the variables from flash
$message = "Name: " . $_POST['yourname'] . "\n\n" . "Company: " . $_POST['company'] . "\n\n" . "Phone: " . $_POST['phone'] . "\n\n" . "Website: " . $_POST['website'] . "\n\n" . "Message Type: " . $_POST['messagetype'] . "\n\n" . "Message: " . "\n\n" . $_POST['message'];
$sender = $_POST['sender'];
// include sender IP in the message.
$full_message = "Sender's IP Address: " . $_SERVER['REMOTE_ADDR'] . "\n\n" . $message;
$message= $full_message;
// remove backslashes
$message = stripslashes($message);
$subject = stripslashes($subject);
$sender = stripslashes($sender);
$yourname = stripslashes($yourname);
// subject line
$subject = "Sent From Contact Form". $subject;
// send the email
if(isset($message) and isset($subject) and isset($sender)){
mail("myemail@gmail.com", $subject, $message, "From: $sender");
}
?>