GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   i suck at this - help (https://gfy.com/showthread.php?t=1056339)

Mutt 02-05-2012 12:11 PM

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']);

?>


grumpy 02-05-2012 12:27 PM

is mail enabled on your server?

FlexxAeon 02-05-2012 12:34 PM

$headers .= 'From: '.$email . "\r\n";

to

$headers .= 'From: '.$_POST['txt_email'] . "\r\n";

Mutt 02-05-2012 12:38 PM

Quote:

Originally Posted by grumpy (Post 18736348)
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.

raymor 02-05-2012 01:07 PM

Quote:

Originally Posted by FlexxAeon (Post 18736362)
$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.

sixsax 02-05-2012 01:09 PM

Sanitize dat inputz! http://php.net/manual/en/filter.filters.sanitize.php

FlexxAeon 02-05-2012 01:15 PM

Quote:

Originally Posted by raymor (Post 18736431)
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.

:thumbsup

Mutt 02-05-2012 01:21 PM

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.

Deej 02-05-2012 04:02 PM

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!


All times are GMT -7. The time now is 11:35 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123