focus
Member
- Messages
- 128
- Reaction score
- 0
- Points
- 16
I think someone has used SQL to send lots of emails using the PHP pages i have. i just received 100 emails at the exact same time. Can someone please advise how i can stop this from happening? I have deleted the whole website from the server for the time being so they cannot keep doing it.
My code is below:
My code is below:
PHP:
<?php
function is_valid_email($from_email)
{
return preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s\'"<>]+\.+[a-z]{2,6}))$#si', $from_email);
}
$headers = "From: bla@hotmail.com\r\n";
$headers .= "MIME-Version: 1.0\r\n"
. "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"
. "Content-Transfer-Encoding: 7bit\r\n";
$to_email = "bla@hotmail.com";
$subject = "Get-Stepping Order";
$productid.=$_POST['productid']."\n" ;
$sneakername.=$_POST['sneakername']."\n" ;
$fullname.=$_POST['fullname']."\n" ;
$size.=$_POST['size'] ."\n" ;
$address.=$_POST['address'] ."\n" ;
$suburb.=$_POST['suburb']."\n" ;
$city.=$_POST['city']."\n" ;
$state.=$_POST['state'] ."\n" ;
$postcode.=$_POST['postcode']."\n" ;
$phone2.=$_POST['phone2']."\n" ;
$phone.=$_POST['phone'] ."\n" ;
$from_email.=$_POST['from_email']."\n" ;
$payment.=$_POST['payment']."\n" ;
$comment.=$_POST['comment']."\n" ;
$message = "
<body>
<b>Sneaker Order:</b><br>
<p>Click on the below image to enlarge it.</p>
<a href='http://i1016.photobucket.com/albums/af289/freshkicks2010/16649.jpg'>
<img src='http://i1016.photobucket.com/albums/af289/freshkicks2010/16649.jpg' width='182' height='135' alt='www.freshkicks.com.au'></a>
<br> <br>
<b>Product ID:</b><br>
$productid
<br> <br>
<b>Sneaker Name:</b><br>
$sneakername
<br> <br>
<b>Full Name:</b><br>
$fullname
<br> <br>
<b>Shoe Size:</b><br>
$size
<br> <br>
<b>Street Address:</b><br>
$address
<br> <br>
<b>Suburb:</b><br>
$suburb
<br> <br>
<b>City:</b><br>
$city
<br> <br>
<b>State:</b><br>
$state
<br> <br>
<b>Post Code:</b><br>
$postcode
<br> <br>
<b>Contact Number</b><br>
$phone
<br> <br>
<b>Email:</b><br>
$from_email
<br> <br>
<b>Payment Method:</b><br>
$payment
<br> <br>
<b>Comment:</b><br>
$comment
<br> <br>
<b>Terms & Conditions:</b><br>
I $fullname, have read and agreed with the terms & conditions.
<br> <br>
<br> <br>
</body>
";
$sent = mail($to_email, $subject, $message, $headers) ;
?>
</p>
</p>
<p><br>
<a href="../../mens.html">Click here to go back to continue shopping</a></p>
</div>