Hi, I had an account a while back but lost it lol... need a little help... prob simple but cant figure it... i want to have a user input a date and for php to work out that date 120 days later... thing is i want this to be emailed... basic code so far and it works but cant get it to work with the date maniplation.
<?php
// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "my email is here!!!";
$Subject = "DEAL:";
$Deal = Trim(stripslashes($_POST['Deal']));
$Sites = Trim(stripslashes($_POST['Sites']));
$TOS = Trim(stripslashes($_POST['TOS']));
$SST = Trim(stripslashes($_POST['SST']));
$DV = Trim(stripslashes($_POST['DV']));
$DCP = Trim(stripslashes($_POST['DCP']));
$NOTES = Trim(stripslashes($_POST['NOTES']));
$Status = Trim(stripslashes($_POST['Status']));
// validation
$validationOK=true;
if (Trim($Deal)=="") $validationOK=false;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.php\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Deal Done By: ";
$Body .= $EmailFrom;
$Body .= "\n";
$Body .= "\n";
$Body .= "Deal Name: ";
$Body .= $Deal;
$Body .= "\n";
$Body .= "\n";
$Body .= "Number Of Sites: ";
$Body .= $Sites;
$Body .= "\n";
$Body .= "\n";
$Body .= "Type Of Sale: ";
$Body .= $TOS;
$Body .= "\n";
$Body .= "\n";
$Body .= "Supplier Signed To: ";
$Body .= $SST;
$Body .= "\n";
$Body .= "\n";
$Body .= "Deal Value: ";
$Body .= $DV;
$Body .= "\n";
$Body .= "\n";
$Body .= "Notes: ";
$Body .= $NOTES;
$Body .= "\n";
$Body .= "\n";
$Body .= "Date Can Be Processed: ";
$Body .= $DCP;
$Body .= "\n";
$Body .= "\n";
$Body .= $Status;
$Body .= "\n";
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=oksub.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.php\">";
}
?>