Opt-Out Script
Posted: Fri Sep 05, 2008 1:54 pm
Hello everyone, I am a first time poster here and have what I hope to be a simple question.
I don't have much experience with php script but have enough knowledge (I think) to pull this off with some help. I am trying to create a script for an Opt-out form to remove somebody from a mailing list. Basically all I want it to do is retrieve the email to be removed from an html form and e-mail this info to an employee so he can remove it from the database. Here is the code that I am attempting to use:
Also, I want to create a success and failed page but am unsure how to call them from the script. As you can see I have the variable setup for it but am unsure what command to use in php to actually tell the browser to goto that url instead of just displaying it. Is there some sort of getURL command?
Thank you very much for any help!
I don't have much experience with php script but have enough knowledge (I think) to pull this off with some help. I am trying to create a script for an Opt-out form to remove somebody from a mailing list. Basically all I want it to do is retrieve the email to be removed from an html form and e-mail this info to an employee so he can remove it from the database. Here is the code that I am attempting to use:
Code: Select all
<?php
$to_1 = "test@test.net";
$subject = "Opt-Out Request";
$email = $_POST['e_mail'];
$msg = "Please remove me from your mailing list.\nE-Mail: $e_mail";
$path = "optout_sc.php";
$headers = "From:test@test.net\n";
$mail_status = mail($to_1,$subject,$msg,$headers);
if($mail_status){
echo "$path";
}
else{
echo "There has been an error processing your request";
}
?>Thank you very much for any help!