Hello, I am new to the forums and new to writing php code, which is why I am here seeking advice. Yesterday my site was hacked and a sendmail script I use was used to send tons of spam mail. The server place was not happy obviously, and they removed my script, which made it imposssible for people to send pages of my site to frirends.
I have copied the send mail code blow, the inputs to the script are put into a form by the user and this script sends the mail. I have replaced some of the fields with GENERIC entries for security reasons.
All the guys at the server company speek of "securing" your sendail scripts and Im really not sure how to even start doing that. Can it be done to this script? Is it difficult if so can I possible offer payment for help?
Please help me out any advice is good and if my script can't be secured or made hack proof than can someone recomend a good send page script for me....
Thanks
Here's the code.
<?php
$ip = getenv("REMOTE_ADDR");
if (!isset($visitormail) || !isset($friendmail))
echo "<font size=6>Please Try Again</font> $ip" ;
$todayis = date("l, F j, Y, g:i a") ;
$notes = stripcslashes($notes); $messageis = " $todayis [EST] \n
Your Friend: $visitor ($visitormail)\n
Wants you to check this out: $sitename ($urlis) \n
To: $friend $friendmail \n
Your Friends Comments: $notes \n
MY NOTES HERE ( http://www.MYURLHERE/ ) ";
$messageme = $ip . " " . $messageis;
$from = "From: $myemail\r\n";
if ($myemail != "")
mail($myemail, $sitename, $messageme, $from);
if ($friendmail != "")
mail($friendmail, $sitename, $messageis, $from);
?>