Search code examples
phpformspostserverconnection-timeout

mail() PHP insertion in $_POST causing connection timeout


When I try to visit our website on our server my pc (and my pc alone) gets a time out error when trying to visit any part of the site.

This is how I caused the problem, I inserted:

?>
< ?php 
$to = 'myemail'; 
$subject = 'test'; 
$text = 'test2'; 
$header = 'test3'; 
mail($to,$subject,$text,$header); ?>
< ?php 

(without the spaces behind the < ).

In $_POST['var2'] field on my websites form to test the difference between strip_tags($_POST['']) and regular unprotected $_POST[''].

That $_POST[''] field together with a couple more feed into a $url variable below:

$url = 'ourwebsite/filecontainingthis$urlvariable.php?VAR1='.strip_tags($_POST['var1'].'&VAR2='.$_POST['var2'].'&VAR3='.strip_tags($_POST['var3']);

(Where myemail was my actual functioning email adress and ourwebsite is the actual adres of our website)

I have done the following to try and remove the problem:

  • Cleared all cookies and history from my browser

  • Used another browser

  • Rebooted pc

  • Given it a day to see if the request gets automatically removed by the server

How can I regain access to the website on this pc/stop that broken request?


Solution

  • It turns out that doing this causes your host to flag you as a malicious/spam e-mail sender. Your options are to contact your host to get the block lifted or wait out the quarantine period if applicable.