Jump to content

Recommended Posts

How can I add reply to fuction to my script?  I would like to automatically send a response to submitter with form contents plus a simple message.  My code is:

 

<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Club');
pt_register('POST','OtherClub');
pt_register('POST','Team');
pt_register('POST','Age');
pt_register('POST','Division');
pt_register('POST','League');
pt_register('POST','Division0607');
pt_register('POST','Wins');
pt_register('POST','Losses');
pt_register('POST','Ties');
pt_register('POST','Place');
pt_register('POST','Tournaments0607');
pt_register('POST','Coach');
pt_register('POST','CoachAddress');
pt_register('POST','CoachCity');
pt_register('POST','CoachZip');
pt_register('POST','CoachPhone');
pt_register('POST','Coachemail');
pt_register('POST','Manager');
pt_register('POST','ManagerAddress');
pt_register('POST','ManagerCity');
pt_register('POST','ManagerZip');
pt_register('POST','ManagerPhone');
pt_register('POST','Manageremail');
pt_register('POST','Field');
pt_register('POST','Scheduler');
pt_register('POST','SchedulerPhone');
pt_register('POST','Scheduleremail');
pt_register('POST','Assignor');
pt_register('POST','AssignorPhone');
pt_register('POST','Assignoremail');
pt_register('POST','District');
pt_register('POST','Registrar');
pt_register('POST','Sept8');
pt_register('POST','Sept9');
pt_register('POST','Sept15');
pt_register('POST','Sept16');
pt_register('POST','Sept22');
pt_register('POST','Sept23');
pt_register('POST','Sept29');
pt_register('POST','Sept30');
pt_register('POST','Oct6');
pt_register('POST','Oct7');
pt_register('POST','Oct13');
pt_register('POST','Oct14');
pt_register('POST','Oct20');
pt_register('POST','Oct21');
pt_register('POST','Oct27');
pt_register('POST','Oct28');
pt_register('POST','Rules');
pt_register('POST','Signed');
pt_register('POST','Duties');
pt_register('POST','ContactPhone');
pt_register('POST','email');
if($Club=="" || $Team=="" || $Age=="" || $Division=="" || $Rules=="" || $Signed=="" || $Duties=="" || $ContactPhone=="" || $email=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Club: ".$Club."
Other Club: ".$OtherClub."
Team: ".$Team."
Age: ".$Age."
Division: ".$Division."
League: ".$League."
Division 06/07: ".$Division0607."
Wins: ".$Wins."
Losses: ".$Losses."
Ties: ".$Ties."
Place: ".$Place."
Tournaments 06/07: ".$Tournaments0607."
Coach: ".$Coach."
Coach Address: ".$CoachAddress."
Coach City: ".$CoachCity."
Coach Zip: ".$CoachZip."
Coach Phone: ".$CoachPhone."
Coach email: ".$Coachemail."
Manager: ".$Manager."
Manager Address: ".$ManagerAddress."
Manager City: ".$ManagerCity."
Manager Zip: ".$ManagerZip."
Manager Phone: ".$ManagerPhone."
Manager email: ".$Manageremail."
Field: ".$Field."
Scheduler: ".$Scheduler."
Scheduler Phone: ".$SchedulerPhone."
Scheduler email: ".$Scheduleremail."
Assignor: ".$Assignor."
Assignor Phone: ".$AssignorPhone."
Assignor email: ".$Assignoremail."
District: ".$District."
Registrar: ".$Registrar."
September 8: ".$Sept8."
September 9: ".$Sept9."
September 15: ".$Sept15."
September 16: ".$Sept16."
September 22: ".$Sept22."
September 23: ".$Sept23."
September 29: ".$Sept29."
September 30: ".$Sept30."
October 6: ".$Oct6."
October 7: ".$Oct7."
October 13: ".$Oct13."
October 14: ".$Oct14."
October 20: ".$Oct20."
October 21: ".$Oct21."
October 27: ".$Oct27."
October 28: ".$Oct28."
Rules: ".$Rules."
Signed: ".$Signed."
Duties: ".$Duties."
Contact Phone: ".$ContactPhone."
email: ".$email."
";
$message = stripslashes($message);
mail("***@***.org","Fall 2007 Registration",$message,"From: $email");
$link = mysql_connect("***","***","***");
mysql_select_db("***",$link);
$query="insert into f2007_registrations (Club,Other_Club,Team,Age,Division,League,Division_0607,Wins,Losses,Ties,Place,Tournaments_0607,Coach,Coach_Address,Coach_City,Coach_Zip,Coach_Phone,Coach_email,Manager,Manager_Address,Manager_City,Manager_Zip,Manager_Phone,Manager_email,Field,Scheduler,Scheduler_Phone,Scheduler_email,Assignor,Assignor_Phone,Assignor_email,District,Registrar,Sept8,Sept9,Sept15,Sept16,Sept22,Sept23,Sept29,Sept30,Oct6,Oct7,Oct13,Oct14,Oct20,Oct21,Oct27,Oct28,Rules,Signed,Duties,Contact_Phone,email) values ('".$Club."','".$OtherClub."','".$Team."','".$Age."','".$Division."','".$League."','".$Division0607."','".$Wins."','".$Losses."','".$Ties."','".$Place."','".$Tournaments0607."','".$Coach."','".$CoachAddress."','".$CoachCity."','".$CoachZip."','".$CoachPhone."','".$Coachemail."','".$Manager."','".$ManagerAddress."','".$ManagerCity."','".$ManagerZip."','".$ManagerPhone."','".$Manageremail."','".$Field."','".$Scheduler."','".$SchedulerPhone."','".$Scheduleremail."','".$Assignor."','".$AssignorPhone."','".$Assignoremail."','".$District."','".$Registrar."','".$Sept8."','".$Sept9."','".$Sept15."','".$Sept16."','".$Sept22."','".$Sept23."','".$Sept29."','".$Sept30."','".$Oct6."','".$Oct7."','".$Oct13."','".$Oct14."','".$Oct20."','".$Oct21."','".$Oct27."','".$Oct28."','".$Rules."','".$Signed."','".$Duties."','".$ContactPhone."','".$email."')";
mysql_query($query);

header("Refresh: 0;url=http://www.*******.org/viewpage.php?page_id=46");
?><?php 
}
?>

isn't

mail("***@***.org","Fall 2007 Registration",$message,"From: $email");

the mail to me (my specified email account) code?

 

Don't I need something similar for "reply to"?  I wrote it that way in .cgi but that scripting is so old and not database compatible.

what I ment was more like

 

$admin_body = "This user has registered on the website";
$user_body = "Thanks for creating an account on our website, blablabla";

mail($yourmail, "New user", $admin_body);
mail($usermail, "Thank you", $user_body);

 

something down those lines... think it's possible...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.