Form Mail CGI
I have applications on two sites where I use a form mail CGI-bin script to allow a user to enter contact information and send. It works great, but I'm wondering if there's any easier method than what I'm currently doing. I now direct the form info e-mail to my domain server, and then forward it from there to a private e-mail address.
With CGI form mail, is it possible to simply direct the form data to a private e-mail address, or does it need to go to the domain server first?
Tom
Hi KB:
I'm not an expert by any measure, but here's how it works for me:
1. You'll need a folder on your site root. Mine is calle "cgi-bin". In that folder, there should be several files that are provided by your host. In my case, there are four files in it. That folder needs to be on your local drive and on your host server in your website's root folder.
2. In your code view (or split view), you'll need to insert these three lines of code, filled in with your information (I've indicated data you'll need to fill in for your site in bold italic). Once completed, these three lines of code should be inserted directly below the line that contains the code with your
Make sure you don't lose the " marks when you edit in your info.
Assuming you are using the DWCS4 "form" function and all the other form fields are filled in, you'll need to be sure your "ACTION" field on the form is as follows: http://www.yourdomain.com/cgi-sys/formmail.cgi
Finally, I've found that, at least with my hosts, I have to direct the form data to my domain e-mail address initially. If I want to redirect it from there to my "private" e-mail address (e.g., yahoo, gmail, live.net, other), I have to set up an auto-forward of the domain e-mail to my private e-mail address using the host's C-panel function. I tried just specifying my private e-mail and I got an error message that my private mail address could not be found on the server. I think that if you want form data forwarded directly to a private e-mail address without first having to go through your host server, you'll probably need to use a PHP script -- which is even more "fun" than CGI.
Hope this helps.
Regards,
Tom
Similar Messages
-
Howdy all,
I use DW 2004MX. If this topic has been addressed before, I'm
sorry. I am trying to make a very simple form mail work on my
website; name, address, phone # and send. I know for a fact there
are two types of form scripts on my server, and both are activated.
One is a CGI (gdform.cgi), and the other is a PHP (gdform.php). My
server is Godaddy if that matters. I have read many messages about
form mail, but cannot find out how to MAKE IT ALL WORK. I have been
looking for a step-by-step answer, but no luck so far. BTW, I am a
newbie. The manual I have is "aftermarket", and is near useless for
the form mail stuff. The web address is www.azaleatrail.com
Any help would be greatly appreciated,
Thanks,
MonaLisaWest> One is a CGI (gdform.cgi), and the other is a PHP
> (gdform.php). My server is Godaddy if that matters.
my suggestion from trying to sort out questions from others
hosted with go
daddy- don't bother with either of those scripts.
I assume that you can use php files within your site?
If yes- i suggest this script:
http://boaddrink.com
-->phpformmail
the instructions are in the zipped folder.
short list of instructions i suggest (use your own info of
course)
http://groups-beta.google.com/group/macromedia.dreamweaver/search?q=alan+php
formmail+edit+recipient&start=0&scoring=d&
1)go to
http://boaddrink.com
-->phpformmail
download it.
http://www.boaddrink.com/projects/files/phpformmail/phpformmail_class...
.2.zip
extract the ZIP file.
2) open formmail.php in dreamweaver
Make the following changes (in code view, turn line numbers
on)
2a)
line 4,
define('CHECK_REFERER', true);
change to:
define('CHECK_REFERER', false);
reason: too many people use a firewall or Norton security to
restrict this.
2b)
Line 43
$referers = array('www.example.com', 'example.com');
change to the url address of your web site.
reason: this probably isn't needed since we just turned the
referrer
checking off. but change it anyway.
2c) *********this is the hard-coding of the recipient address
into the php
file, where it is totally invisble**********
Line 46
$recipient_array = array();
change to:
$recipient_array = array('me' =>
'[email protected]);
**put YOUR email address in to replace
[email protected]
reason: this sets the email address the form results will be
sent to.
3) now do a File-->Save As and save this file to within
this Local Site
folder.
4) in dw's File Panel, find formmail.php and upload it to the
remote site.
5) Now open your form html file in dreamweaver,
5a)click the mouse into the form area, and select the
<form> tag on the
lower left margin of the design window.
In the Property Inspectory, it should now show the properties
of the <form>
tag. In the Property Inspector, to the right of the ACTION
line, click the
folder icon and browse to and select the copy of the
formmail.php file
you've saved to within this site.
5b) now go to dw menu-->Insert-->Form
Objects-->Hidden Field
This inserts a hidden form field.
In the property inspector, change the NAME of this field to:
recipient
And the VALUE of this field to: me
the code should look like:
<input name="recipient" type="hidden" id="recipient"
value="me">
6) Save and upload the form page.
Try the form from the website.
Optional:
make a new page for a thank you for submitting message.
In the form, insert another hidden field.
Name: redirect
Value: the full absolute
http:// address to the new thank you page.
There is other information about that script in the Docs
folder.
Alan
Adobe Community Expert, dreamweaver
http://www.adobe.com/communities/experts/ -
I have loaded form mail into my hosting account for
juliashipley.com not sure which code to use don't need the ones
that create a form so that leaves 2 a very short script which does
not work and the other folder has a huge long script. Can someone
point me in the right direction its the only thing holding my site
up now.
Many thanks
JuliaHi Julie,
Don't get discouraged :-)
I took a look at your host's instructions. It looks like the
script resides
in a folder called hp_formmail or some variant depending on
which script you
pic.
The instructions aren't very in depth.
So, possibly another approach?
Can you find out what server side language your hosting plan
supports? It
should say in your hosting information. Look for ASP or PHP.
Do you have a Linux or Windows hosting plan?
If it's Windows, I can help you with a very easy ASP page
that you can just
upload to the host into the same folder as your contact page.
If PHP, there's lot's of pretty straight forward tutorials we
can point you
to.
There is a chance your host or plan limits this, unlikely but
with the
sparse instructions on form mail I'm not discounting it, so
if worse comes
to worst I'll be happy to help you through email where you
can send me the
instructions they say pop up when you choose a script, as
well as their
script and we can figure it out.
Take care,
Tim
"Juliamay" <[email protected]> wrote in
message
news:foigr7$8jg$[email protected]..
> Hi Tim,
>
> Have done what you said none of the info is in the
cgi-bin you click on
> /hp_formmail_noimg and that takes you to several items
including samples.
> Sorry
> I am really confused now not difficult at 53 I am amazed
I got this far
> its
> taken me twice as long as it should but I really don't
understand this
> bit. I
> have emailed the college but do not expect much joy.
Thanks for trying.
>
> Julia
> -
Forms (form-mail) problem
I've been searching for days on end to try and solve this problem but have to admit defeat. What I am trying to do is to just get a form on my website to work. I have created the form and now I somehow need to get the info from the form sent to my email address. I've had a look at various form-mail scripts, but find it hard to understand what to do with them. I've contacted my web hoster, but all I can ascertain from them is that they don't supply a script for this and that when I have one I should upload it into /public_html/cgi-bin
I have decided it would be easier to purchase something which creates the script for my form, but I'm unsure as to what format to get. I have a choice of PHP or Perl (my web hoster provides both) - Is one better than the other? If someone could advise me on this I'd really, really appreciate it!Okay,
Well your not going to just magically have this working I would say today. What I would suggest is to invest in a getting started book in PHP. PHP is simple but you must take a step back from what you are doing and just spend a day or two reading some not all of the book to see whats going on. Then write a couple little things from the examples to get a starting grasp on it. I am sure that there are plenty of PHP developers in these Adobe forums that would be glad to assist you with this once you have made some effort into picking up PHP. PHP will allow you do more than just static html pages. Perl I have not done but have heard its more like programming or regular expressions so I would not suggest that you start there. PHP would be an easier path to get started on.
Buy an intro book
Get your system setup
Read along with it as you try and code or just read it then code
Ask questions -
Hello Everyone,
I am starting to learn Flash and created a form mailer for a website I am working on. The following code is what I have in AS3.0 and it all loads fine in the web browser, but I do not receive the email with the info.
var address:String = "gdform.php";
var url:URLRequest;
var variables:URLVariables = new URLVariables ();
variables.subject = "New Fighter Profile";
submit_btn.addEventListener(MouseEvent.CLICK,sendForm);
function sendForm(event:MouseEvent):void{
variables.FirstName = firstname_txt.text;
variables.LastName = lastname_txt.text;
variables.Birthdate = birthdate_txt.text;
variables.Nickname = nickname_txt.text;
variables.HeightFt = hft_txt.text;
variables.HeightIn = hin_txt.text;
variables.Weightclass = weightclass_txt.text;
variables.RecWins = wins_txt.text;
variables.RecWins = losses_txt.text;
variables.Debut = debut_txt.text;
variables.Hometown = hometown_txt.text;
variables.FightClub = fightclub_txt.text;
variables.Styles = styles_txt.text;
variables.Email = email_txt.text;
variables.Bio = bio_txt.text;
url = new URLRequest (address);
url.method = URLRequestMethod.POST;
url.data = variables;
navigateToURL (url);
var reqThanks:URLRequest=new URLRequest("thanks.html");
navigateToURL(reqThanks,"_blank");
var reqHome:URLRequest=new URLRequest("index.html");
navigateToURL(reqHome,"_parent");
Please Help!
Thanks,
JohnMaybe someone here can help.
In spite of the site name, it is a Mac video card site. -
What is a good resource for pre-made PHP Form Mailer Scripts.
This is for use with a website hosted on GoDaddy.
My client has a few requirements that the GoDaddy script does
not offer (and the script I chose from GoDaddy is uneditable). I
know nothing about scripting but thought I could use a pre-made
script and modify it...is that crazy thinking on my part?
Here are the special requests from my client:
- They'd like to see the time the form was submitted in EST
(the GoDaddy script puts the time in military time in another time
zone in the subject line). Can this appear in the body of the email
as well as the subject line?
- They'd like the form to be sent to the person submitting it
as well as to their company
- They would like to be able to REPLY TO the email they
receive with the form submission and have it be addressed to the
person submitting the form. The current script has the email
addressed to themselves (the company) if they click REPLY TO, so
they are replying to themselves
- Although this has nothing to do with the Form Mailer script
as far as I can guess, they asked that the person filling out the
form be able to print it prior to submitting (in my opinion,
though, if i can have a copy of the submission sent to the
submitter, there's no reason for this). But if anyone knows how to
do this, please let me know.
- Finally, the client wants to know if each submission can
have a unique tracking number assigned to it.
Thank you all. Any feedback is appreciated.
RichardHi,
I can without any doubt recommend Forms 2 Go:
http://www.bebosoft.com/products/formstogo/index.php
Very easy to use and even someone like me who don't know a
lot of
programming, use it extensively.
Deon
"RichyZee" <[email protected]> wrote in
news:gcvkac$fcp$[email protected]:
> What is a good resource for pre-made PHP Form Mailer
Scripts. This is
> for use with a website hosted on GoDaddy.
>
> My client has a few requirements that the GoDaddy script
does not
> offer (and
> the script I chose from GoDaddy is uneditable). I know
nothing about
> scripting but thought I could use a pre-made script and
modify it...is
> that crazy thinking on my part?
>
> Here are the special requests from my client:
>
> - They'd like to see the time the form was submitted in
EST (the
> GoDaddy
> script puts the time in military time in another time
zone in the
> subject line). Can this appear in the body of the email
as well as the
> subject line?
>
> - They'd like the form to be sent to the person
submitting it as well
> as to
> their company
>
> - They would like to be able to REPLY TO the email they
receive with
> the form
> submission and have it be addressed to the person
submitting the form.
> The current script has the email addressed to themselves
(the company)
> if they click REPLY TO, so they are replying to
themselves
>
> - Although this has nothing to do with the Form Mailer
script as far
> as I can
> guess, they asked that the person filling out the form
be able to
> print it prior to submitting (in my opinion, though, if
i can have a
> copy of the submission sent to the submitter, there's no
reason for
> this). But if anyone knows how to do this, please let me
know.
>
> - Finally, the client wants to know if each submission
can have a
> unique
> tracking number assigned to it.
>
> Thank you all. Any feedback is appreciated.
>
> Richard
>
> -
Interactive Form - mail subject
Hi SDN,
In an offline interactive form scenario, the subject of the email is like a code (cryptic).
Is possibile to change the subject of the email?
THX.Hi,
I am not sure what you mean by cryptic... In any case, the e-mail sent out with interactive forms is generated using a certain mail template. This is FORM_FILLOUT, if I'm not wrong. It is configured in Visual Administrator, but you can of course replace it with a custom template.
You can design the template in the Administration workset and then configure the mime.id.forms.mail property in VA with the new template name.
For more info look at:
<a href="http://help.sap.com/saphelp_nw70/helpdata/en/17/f156428367bd30e10000000a155106/frameset.htm">Managing E-Mail Templates</a>
<a href="http://help.sap.com/saphelp_nw70/helpdata/en/6a/fa96421ae6c66ae10000000a155106/frameset.htm">Configuration for Guided Procedures Forms</a>
HTH:)
Regards, Petja -
Help with ASP form mail code PLEASE
Hello
I am SOOooo close to this form mail code working correctly.
It is correctly sending the forms info to the form owner via
an email.
The only problem is it also sends an email as soon as the
page spawns and before the form is filled out. (with just the
labels of course)
Could someone PLEASE take a look and tell me specifically
what to change? Trying to woo the boss!
Thank you.
(I included the code for the form mail only....let me know if
I need to post the code for the whole ASP doc)See: http://developers.sun.com/techtopics/mobility/midp/articles/midp2network/
-
Hey Guys
I have set up a file named form.php but I get the following
error message when I submit a form:
Method not Allowed
The requested method POST is not allowed for the URL
/form.php.
Why is this? I have used the famous
http://boaddrink.com PHP script.
Any replies would be greatly appreciated.
Thanks =P .> they say I can use PERL or CGI. So then...got any
recommended scripts that I
> can use?
does the hosting have a control panel or CPanel? if yes- look
in there for a
preinstalled script. Check their faq/support info for a
preinstalled script.
Also look there for the password protected directory
question.
if no script,
http://nms-cgi.sourceforge.net
the nms-formmail script.
note- edit the script only with an editor that will save it
with Unix line
breaks. Windows line breaks will ruin the script file for
your linux hosting
(dw prefs-->code format-->line feeds)
Alan
Adobe Community Expert, dreamweaver
http://www.adobe.com/communities/experts/ -
Form mail not working cgi...
Hi all
been trying this for 3 days now! i had a site and used php -
easy! but changed site that uses cgi.
instructions: download formfile... done.
save it to cgi-bin folder - dont have one, so created one...
thats probably not the right thing to do??
moved formail file to cgi-bin
changed all relevant data.
changed my 'competition.html' form with all relevant data.
Uploaded cgi-bin folder and competition form...
I get" Internal Server Error
The server encountered an internal error or misconfiguration
and was unable to complete your request.
Please contact the server administrator,
[email protected] and inform them of the time the error
occurred, and anything you might have done that may have caused the
error. More information about this error may be available in the
server error log"
My host (so very unhelpful) tells me to check permissions are
set to 755 - but i cant do that... no right click action here..
using dreamweaver 2004.
help!!! where am i going wrong??
thank youa common reason for an internal server error in a Perl script
on a linux web
server is to edit with an app that uses Windows line returns.
It could also be that you haven't set the file permissions.
There was a dw extension called "set permissions" You could
google for it or
use some ftp client or your hosting control panel to set the
file
permissions.
If your remote server is a linux box, you could start with a
fresh copy of
the Perl script, and go into dw preferences->code format
and select Unix
linebreaks. Then make the needed changes to the config
section, upload it,
set permissions.
OR- can you use php on this hosting?
If yes-
1)go to
http://http://developerkarma.com/projects
-->phpformmail
download it.
extract the ZIP file.
**More detailed instructions are in the docs folder.
**These shortcut instructions are for version 1.07 of the
phpformmail
script.
2) open formmail.php in dreamweaver
Make the following changes (in code view, turn line numbers
on)
2a)
line 4,
define('CHECK_REFERER', true);
change to:
define('CHECK_REFERER', false);
reason: too many people use a firewall or Norton security to
restrict this.
2b)
Line 43
$referers = array('www.example.com', 'example.com');
change to the domain name of your web site.
reason: this probably isn't needed since we just turned the
referrer
checking off. but change it anyway.
2c) *this is to hard-code the recipient address into
the php
file, where it is totally invisible *
Line 46
$recipient_array = array();
change to:
$recipient_array = array('me' =>
'[email protected]');
**of course, replace [email protected] with
the email address
you want to receive the form data. Also note the single quote
marks.
reason: this sets the email address the form results will be
sent to.
You can also make a list of possible recipient alias values-
see the readme
in the docs folder.
2d) give the script a default "From" address to use.
Go to line 41
Change:
define('FROM', null);
to:
define('FROM', 'Example Name <[email protected]>');
substituting your name and email address.
3) now do a File-->Save As and save this file to within
this Local Site
folder. save it as anythingyouwant.php
4) in dw's File Panel, find anythingyouwant.php and upload it
to the remote
site.
5) Now open your form html file in dreamweaver,
5a)click the mouse into the form area, and select the
<form> tag on the
lower left margin of the design window.
In the Property Inspector, it should now show the properties
of the <form>
tag. In the Property Inspector, to the right of the ACTION
line, click the
folder icon and browse to and select the anythingyouwant.php
file
you've saved to within this site.
5b) now click within the form area and go to dw
menu-->Insert-->Form
Objects-->Hidden Field
This inserts a hidden form field.
In the property inspector, change the NAME/ID of this field
to: recipient
And the VALUE of this field to: me
the code should look like:
<input name="recipient" type="hidden" id="recipient"
value="me">
This tells the script to use the "me" recipient_alias value
as the email
address to send the form to.
5c: Do you have a form field to collect the user's email
address?
If yes, if this field is named exactly "email" then the
script will use the
user's email as the reply to in the outgoing email
6) Save and upload the form page.
Try the form from the website.
Note also- If you have any form fields that can accept
multiple values, like
a set of checkboxes or a select list, they need to have a
name/ID that endes
in pipebrackets- such as my_form_field[] so the script
processes that
field as an array
Alan
Adobe Community Expert, dreamweaver
http://www.adobe.com/communities/experts/ -
This works fine!
<html>
<head>
<title>Mailform example</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<form name="formmail"
action="/cgi-bin/formmail/formmail.cgi" method="post">
<input type=hidden name="recipient"
value="[email protected]">
<p><b>Subject:</b><br>
<input type=text name="subject" size="45" value="">
</p>
<br>
<p><b>Your Name:</b><br>
<input type=text name="realname" size="45" value="">
</p>
<br>
<p><b>Your Email Address:</b><br>
<input type=text name="email" size="45" value="">
</p>
<br>
<p><b>Comments:</b><br>
<textarea name="body" rows="10" cols="60"
wrap="virtual"></textarea>
</p>
<br>
<p>
<input type="submit" value="Send Email">
<input type="reset" value="Reset Form">
</p>
</form>
</body>
</html>
but when I try to do the same thing in flash
var gatherForm:LoadVars = new LoadVars();
function sendForm():Void {
gatherForm.email_to = "[email protected]";
gatherForm.visitor_name = contactForm.nameInput.text;
gatherForm.visitor_email = contactForm.emailInput.text;
gatherForm.visitor_comments =
contactForm.commentsInput.text;
gatherForm.send("/cgi-bin/formmail/formmail.cgi", "_blank",
"POST");
this.contactForm.submitBtn.onRelease = function():Void {
sendForm();
I get this message:
Error: Bad/No Recipient
There was no recipient or an invalid recipient specified in
the data sent to FormMail. Please make sure you have filled in the
recipient form field with an e-mail address that has been
configured in @recipients.
The recipient I have specified is jimsannex.com and it works
fine with the html I listed on top. I'm using AS2. Any
Ideas?there's no recipient property for gatherForm, no subject
property, no email property and no body property. other than
sending nothing the cgi file is expecting, you're doing
fine. -
Links donu00B4t work in mail forms(Mailing Campaign)
Hello,
We have created some links in a mail form and when we execute the campaign, the
link doesn´t navegate to the URL.
The code is as follows:
href="/exchweb/bin/redir.asp?URL=http://www.efeservicios.com
It happens the same with a sound link, the page doesn´t load, and the defined code is as follows:
href="/exchweb/bin/redir.asp?URL=http://www.EFE.com/radio/mkt/copaamerica.asx
Any solution??
I´ll reward points!!
Luis Angel Fernández
CRM ConsultantSorry, the forum created links of my post automatically
I meant to say:
Hi,
Normally, the HTML code should look like this:
{a href="/exchweb/bin/redir.asp?URL=http://www.efeservicios.com">PUT YOUR DESCRIPTION OF THE LINK HERE</a}
CHANGE the { to an < and the } to an >
If your link should point to http://www.efeservicios.com, it should be:
{a href="http://www.efeservicios.com">PUT YOUR DESCRIPTION OF THE LINK HERE</a}
again, CHANGE the { to an < and the } to an >
Hope this helps!
Jeroen -
How to Set a Form Mail Address
I have a form all set up on a web page in DW and what it's
supposed to do, but I don't know where the field is to put my
e-mail address for the form to send the info to. I tried putting it
in "action", but that's not it as a test to see if I'd get anything
failed. So, where
do I put my e-mail?There are only two ways to process form data -
1. Use mailto:[email protected] as the action of the form
2. Use a server-side scripting method to a) harvest the
form's data, b)
process it in some manner, e.g., enter it into a database, c)
formulate and
send an email to one or more email recipients, and d)
redirect the visitor
to some ending page
Method 1 is quite simple, and is also the least reliable. It
depends both
on your visitor having an email client already installed on
their computer -
this eliminates public computers, or home users without email
clients
installed (more and more it seems) - and on the installed
email client
responding to
the mailto call. It is not possible to use this method *and*
send the
visitor to a
thank you page as well.
Method 2a is the preferred method, since it eliminates the
problems of
method
1, but it means that you have to grapple with
server-scripting somehow (ASP,
CF, PHP, perl, etc.).
Method 2b would be to use some third-party form processing,
like
http://www.bebosoft.com/products/formstogo/.
You would have to decide which of these methods is best for
your needs,
but if it's Method 2a, then start by asking your host what
they provide for
form
processing. If it's 2b, then read their FAQ/instructions
carefully.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"DanMat6288" <[email protected]> wrote in
message
news:fm3p7l$517$[email protected]..
>I have a form all set up on a web page in DW and what
it's supposed to do,
>but
> I don't know where the field is to put my e-mail address
for the form to
> send
> the info to. I tried putting it in "action", but that's
not it as a test
> to see
> if I'd get anything failed. So, where
do I put my e-mail?
> -
Hi, we're using a pdf form (created with adobe X Pro) with the iPad reader. After last update, 11.3.1, the mailto attribute of the send form button is not working. The mail with the attachment opens without the pre-filled mail address. Prior the update it was perfectly working. Any idea how to solve it or if it will be fixed in a future update?
Best Regards
LorenzoIf I use the following settings for the submit button...
...the iOS Mobile Reader does appear to process it correctly.
I presume the xxxxxxx refers to something else. Does this something else have any special characters in it? Special characters in a URL need to be percent encoded to be valid. We switched to the Apple URL parser in the latest iOS Mobile Reader release which is more strict than the parsing we were doing ourselves in prior releases.
Darrell -
I used this script
http://www.visibilityinherit.com/code/php-form-validation.php
to produce a form and everything worked fine on my site, which I
was using for testing. When I transferred over to the client's site
it doesn't send the email. The error and thank you messages work,
but no email. As I have heard that some hosts block some php files
with the name 'formmail' I called it something else.
I have checked and rechecked all the data and only my email
address and the URLs for the error and thank you pages had to be
changed, my email is correct, but still not email.
Any ideas as to what is happening and how I can get around it
please?
RosalindI have been sent the following information and code, but have
not succeeded in working out where to add it. The code I am using
is underneath. Many thanks
- to send emails through our servers you must comply with one
of the following rules
a. The sending email must be from your domain
b. The receiving email must be from your domain
This account could/should be [email protected]
- To avoid a wrong use of our scripts by spammers you must
had a line before you call the “mail” functionality
ini_set("sendmail_from", " [email protected] ");
- Please add to the email send code a functionality
“-f” in the fifth parameter of the function send mail
- This is the simple configuration of sending emails in php
<?php
ini_set("sendmail_from", [email protected]);
mail($email_to, $email_subject, $email_message, $headers,
'-f'[email protected]);
?>
my php code is
<?php
// Input Your Personal Information Here
$mailto = '[email protected]' ;
$from = "FormosaParadise.com" ;
$formurl = "
http://formosaparadise.com/correios.php"
$errorurl = "
http://formosaparadise.com/formmailerror.php"
$thankyouurl = "
http://formosaparadise.com/thankyou.php"
// End Edit
// prevent browser cache
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "
GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
function remove_headers($string) {
$headers = array(
"/to\:/i",
"/from\:/i",
"/bcc\:/i",
"/cc\:/i",
"/Content\-Transfer\-Encoding\:/i",
"/Content\-Type\:/i",
"/Mime\-Version\:/i"
if (preg_replace($headers, '', $string) == $string) {
return $string;
} else {
die('You think Im spammy? Spammy how? Spammy like a clown,
spammy?');
$uself = 0;
$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" :
"\n" ;
if (!isset($_POST['email'])) {
header( "Location: $errorurl" );
exit ;
// Input Your Personal Information Here
$name = remove_headers($_POST['name']);
$email = remove_headers($_POST['email']);
$phone = remove_headers($_POST['phone']);
$comments = remove_headers($_POST['comments']);
$http_referrer = getenv( "HTTP_REFERER" );
// End Edit
if
(!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i",$email))
header( "Location: $errorurl" );
exit ;
// Input Your Personal Information Here
if (empty($name) || empty($email) || empty($phone)
||empty($comments)) {
header( "Location: $errorurl" );
exit ;
// End Edit
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
// sets max amount of characters in comments area (edit as
nesesary)
if (strlen($comments) > 1250) {
$comments=substr($comments, 0, 1250).'...';
// End Edit
$message =
"This message was sent from:\n" .
"$http_referrer\n\n" .
// Input Your Personal Information Here
"Name: $name\n\n" .
"Email: $email\n\n" .
"Phone No: $phone\n\n" .
"Comments: $comments\n\n" .
"\n\n------------------------------------------------------------\n"
// End Edit
mail($mailto, $from, $message,
"From: \"$name\" <$email>" . $headersep . "Reply-To:
\"$name\" <$email>" . $headersep );
header( "Location: $thankyouurl" );
exit ;
?>
Maybe you are looking for
-
Is it possible to use wildcards to match cell contents in an if statement?
I need to return a ID along with some other information on a page by page basis, so that the information comes out linked by position. I use a couple of loops and if statements to navigate through the document. I am able to use exact matches of cel
-
IOS 7.1.2 sync issue with iPhone 5 iTunes 11.2.2.3 windows 7
Unable to sync content with iPhone 5 after upgraded to iOS 7.1.2 running iTunes 11.2.2.3 on Windows 7. Photo albums are messed up initially, then re-sync a few times and ended up with iTunes summary tab status showing capacity usage as only "Other".
-
Help! Computer won't get past startup.
Hi! I'm having trouble with my G4 since yesterday. I bought a new battery and installed it on friday. The computer worked fine until yesterday when it suddenly restarted but it never got past the startup screen (apple logo). I tried repairing the dis
-
Hi All, how to check statistics of free background work process in the system. Regards, MK
-
Editing XML and writing to a file.
jus made some changes to an xml using the below code DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse("cric.xml"); Element elem = doc.getDocumentElemen