Jump to content

Help - Form reply to


kemper

Recommended Posts

I am utilizing forms to gather data to mysql database.  All is working with no problems.  I want to the information to be sent back to the submitting person as a confirmation as a reply to process.  I was originally thinking that I could setup a responder through my host to reply with same email criteria, but cannot.

 

I am assuming that the scripting would have to be inserted into the process.php, but am not sure how to do so.  Assistance is greatly appreciated.

 

My process 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("***@****.***","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.***.***/viewpage.php?page_id=46");
?><?php 
}
?>

Link to comment
https://forums.phpfreaks.com/topic/48025-help-form-reply-to/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.