Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-05-2012, 12:11 PM   #1
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
i suck at this - help

can anybody tell me why this little contact form isn't working for me? i get 'Mail Error' when I submit the form.


PHP Code:
<?


$str="";
$str= "Name:".$_POST['txt_name']."<br><br>"."Email: ".$_POST['txt_email']."<br><br>Subject: ".$_POST['txt_subject']."<br><br>Message: <br>".$_POST['txt_msg'];
$to= '[email protected]' ;
$subject="Free Consultation Form";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '.$email . "\r\n";
$message =   $str;
mail($to,$subject,$message,$headers) or die("Mail Error");


if($_POST['chk_me']==1) {
    $to=  $_POST['txt_email'] ;
    $subject="Free Consultation Form";
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: '.$email . "\r\n";
    $message =   $str;
    mail($to,$subject,$message,$headers) or die("Mail Error");
    
}

header("Location:". $_SERVER['HTTP_REFERER']);

?>
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2012, 12:27 PM   #2
grumpy
Too lazy to set a custom title
 
grumpy's Avatar
 
Join Date: Jan 2002
Location: Holland
Posts: 9,870
is mail enabled on your server?
__________________
Don't let greediness blur your vision | You gotta let some shit slide
icq - 441-456-888
grumpy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2012, 12:34 PM   #3
FlexxAeon
Confirmed User
 
FlexxAeon's Avatar
 
Industry Role:
Join Date: May 2003
Posts: 3,765
$headers .= 'From: '.$email . "\r\n";

to

$headers .= 'From: '.$_POST['txt_email'] . "\r\n";
__________________
flexx [dot] aeon [at] gmail

Last edited by FlexxAeon; 02-05-2012 at 12:36 PM..
FlexxAeon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2012, 12:38 PM   #4
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
Quote:
Originally Posted by grumpy View Post
is mail enabled on your server?
well i sent in a ticket to the host 9 hours ago but no response - mainstream host, this isn't for an adult site.
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2012, 01:07 PM   #5
raymor
Confirmed User
 
Join Date: Oct 2002
Posts: 3,745
Quote:
Originally Posted by FlexxAeon View Post
$headers .= 'From: '.$email . "\r\n"; to
$headers .= 'From: '.$_POST['txt_email'] . "\r\n";
and note that you'll find yourself listed as a spammer at some point when the spambots find your form. For the "from" address they'll enter:

[email protected]
Cc: [email protected], [email protected], [email protected]...

For the from address or anything else user submitted, use only the captured text from a proper regex match on valid input.
__________________
For historical display only. This information is not current:
support&#64;bettercgi.com ICQ 7208627
Strongbox - The next generation in site security
Throttlebox - The next generation in bandwidth control
Clonebox - Backup and disaster recovery on steroids
raymor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2012, 01:09 PM   #6
sixsax
Confirmed User
 
Industry Role:
Join Date: Aug 2006
Location: Denmark
Posts: 213
Sanitize dat inputz! http://php.net/manual/en/filter.filters.sanitize.php
sixsax is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2012, 01:15 PM   #7
FlexxAeon
Confirmed User
 
FlexxAeon's Avatar
 
Industry Role:
Join Date: May 2003
Posts: 3,765
Quote:
Originally Posted by raymor View Post
and note that you'll find yourself listed as a spammer at some point when the spambots find your form. For the "from" address they'll enter:

[email protected]
Cc: [email protected], [email protected], [email protected]...

For the from address or anything else user submitted, use only the captured text from a proper regex match on valid input.
__________________
flexx [dot] aeon [at] gmail
FlexxAeon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2012, 01:21 PM   #8
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
tried it on another server - works. this host must have mail blocked.

i have no idea how to make the form spammer proof - it's a jquery mail form called SimpleModal that seems to be very popular.
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2012, 04:02 PM   #9
Deej
I make pixels work
 
Deej's Avatar
 
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
I told you I do that day in and day out...

I must inadvertently pissed in your cheerios at one time or another...

Anyway, the bowl is kicking off. Hit me up if you need future help!
__________________

Deej's Designs n' What Not
Hit me up for Design, CSS & Photo Retouching


Icq#30096880
Deej is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.