Can the form be coded to send the filled out form to not only myself but to the person that filled out the form using the email address they input?
I realize not everyone would use the email field, but does anyone have a code example I could add in so this could be done? I saw one post on the help section that asked this but was directed elsewhere and I never found any further info. Id also like to add in a subject line as well if possible.
Now having asked that I want to say this. What an AWSOME package. I have looked and looked for a PHP form builder and was contemplating how much I was going to have to spend. I even bought some self-teaching books on PHP so I could hopefully at some point make my own. Then I ran across phpFormGenerator. First, the program is free, I was floored at that and that it was so functional. Secondly, the support. When I saw the forums I quite honestly expected to see a bunch of unanswered threads. How wrong could I have possibly been! Not only is it free but there is awsome support here. Kudo's to all involved. I hope version 3 comes out soon I would love to see what it can do.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Simple change to the process.php file.
This is similar to what you have:
//Variables from the form put into a message string to send via the mail() function.
$message="FirstName: ".$FirstName."
LastName: ".$LastName."
Email: ".$Email."
";
//Strip slashes from the message string.
$message = stripslashes($message);
//Send the mail using the mail() function.
mail("youremail@yourdomain","Form Submitted at your website",$message,"From: phpFormGenerator");
You can modify your process.php to do anything you desire.
//Notes from the PHP.net documentation:
//Mail Function Syntax Description
//bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )
So here is what you can do to modify the process.php mail() function:
//Notes from the PHP.net documentation:
//Send to multiple recipients using the $to variable.
$to = 'youremail@yourdomain' . ', '; // note the comma
$to .= $Email; //Variable from your form
//Set a subject
$subject = 'Birthday Reminders for August'; //Could be $Subject from your form, as is done with $Email
//Set the header to specify where the email is from.
$headers = 'From: birthday@example.com'
// Mail it (replaces the original mail() function)
mail($to, $subject, $message, $headers);
These changes allow you to send to multiple emails, set the subject (fixed or dynamic), set the from. I may have missed some detail in the syntax but you get the idea. If you need any help you can contact me anytime.
Hey TNTEverett, thanks for the reply. I'll try and get it going from what you've showed me here so far. If I run into any trouble I'll probably get in touch with you then but I would like to try it and work out any bugs myself first, best way to learn I have found yet.
Thanks for the help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am also having a problem trying to have an auto response sent to the person filling out the form.
Can someone explain to me what exactly I need to change in my process file to get this done? I would really appreciate it.
My process.php looks like this:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
pt_register('POST','Email');
pt_register('POST','Location');
pt_register('POST','Age');
pt_register('POST','CommentsorSuggestions');
$CommentsorSuggestions=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $CommentsorSuggestions);pt_register('POST','Wouldyoulikeustocontactyou');
if($Email=="" || $Location=="" || $Age=="" || $Wouldyoulikeustocontactyou=="" ){
$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="Name: ".$Name."
Email: ".$Email."
Location: ".$Location."
Age: ".$Age."
Comments or Suggestions: ".$CommentsorSuggestions."
Would you like us to contact you: ".$Wouldyoulikeustocontactyou."
";
$message = stripslashes($message);
mail("me@domain.com","Form Submitted at your website",$message,"From: phpFormGenerator");
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi. I'm new to this site but I like what I see so far. My question is this: Is there a way to create a form asking for the user's email address and a file name and then have that file emailed as an attachment to the address they entered?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can the form be coded to send the filled out form to not only myself but to the person that filled out the form using the email address they input?
I realize not everyone would use the email field, but does anyone have a code example I could add in so this could be done? I saw one post on the help section that asked this but was directed elsewhere and I never found any further info. Id also like to add in a subject line as well if possible.
Now having asked that I want to say this. What an AWSOME package. I have looked and looked for a PHP form builder and was contemplating how much I was going to have to spend. I even bought some self-teaching books on PHP so I could hopefully at some point make my own. Then I ran across phpFormGenerator. First, the program is free, I was floored at that and that it was so functional. Secondly, the support. When I saw the forums I quite honestly expected to see a bunch of unanswered threads. How wrong could I have possibly been! Not only is it free but there is awsome support here. Kudo's to all involved. I hope version 3 comes out soon I would love to see what it can do.
Simple change to the process.php file.
This is similar to what you have:
//Variables from the form put into a message string to send via the mail() function.
$message="FirstName: ".$FirstName."
LastName: ".$LastName."
Email: ".$Email."
";
//Strip slashes from the message string.
$message = stripslashes($message);
//Send the mail using the mail() function.
mail("youremail@yourdomain","Form Submitted at your website",$message,"From: phpFormGenerator");
You can modify your process.php to do anything you desire.
//Notes from the PHP.net documentation:
//Mail Function Syntax Description
//bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )
So here is what you can do to modify the process.php mail() function:
//Notes from the PHP.net documentation:
//Send to multiple recipients using the $to variable.
$to = 'youremail@yourdomain' . ', '; // note the comma
$to .= $Email; //Variable from your form
//Set a subject
$subject = 'Birthday Reminders for August'; //Could be $Subject from your form, as is done with $Email
//Set the header to specify where the email is from.
$headers = 'From: birthday@example.com'
// Mail it (replaces the original mail() function)
mail($to, $subject, $message, $headers);
These changes allow you to send to multiple emails, set the subject (fixed or dynamic), set the from. I may have missed some detail in the syntax but you get the idea. If you need any help you can contact me anytime.
More examples can be found here:
http://us2.php.net/function.mail
Hey TNTEverett, thanks for the reply. I'll try and get it going from what you've showed me here so far. If I run into any trouble I'll probably get in touch with you then but I would like to try it and work out any bugs myself first, best way to learn I have found yet.
Thanks for the help.
I am also having a problem trying to have an auto response sent to the person filling out the form.
Can someone explain to me what exactly I need to change in my process file to get this done? I would really appreciate it.
My process.php looks like this:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
pt_register('POST','Email');
pt_register('POST','Location');
pt_register('POST','Age');
pt_register('POST','CommentsorSuggestions');
$CommentsorSuggestions=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $CommentsorSuggestions);pt_register('POST','Wouldyoulikeustocontactyou');
if($Email=="" || $Location=="" || $Age=="" || $Wouldyoulikeustocontactyou=="" ){
$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="Name: ".$Name."
Email: ".$Email."
Location: ".$Location."
Age: ".$Age."
Comments or Suggestions: ".$CommentsorSuggestions."
Would you like us to contact you: ".$Wouldyoulikeustocontactyou."
";
$message = stripslashes($message);
mail("me@domain.com","Form Submitted at your website",$message,"From: phpFormGenerator");
?>
Your answer is in my response to the original post. Try this link, or click on the RE: next to my name above (tnteveret1).
https://sourceforge.net/forum/message.php?msg_id=3486098
Hi. I'm new to this site but I like what I see so far. My question is this: Is there a way to create a form asking for the user's email address and a file name and then have that file emailed as an attachment to the address they entered?
Possible, but not a standard feature.