I have a form on my site I'm trying to send, it works locally only when i upload it to my server I don't receive a message, can anybody see or tell me why this may be?
I understand my form isn't the most secure but I'm not worried about that for now, I'm curious as to why the form doesn't send when it's on my server...
FWIW I'm also running an apache server.
<?php
if ( empty($_POST['req'])) {
echo '<span style="color:#ff0000; font-weight:700; font-size:12px;">Please ensure all fields marked with an asterisk(*) have been completed.</span>';
} else {
foreach ($_POST as $key => $value)
$message = '';
$message .= "Field ".htmlentities($key)." is ".htmlentities($value)."\r\n";
if(mail('liam@site.co.uk', 'Information', $message)){
echo '<span style="color:green; font-weight:700; font-size:12px;">Thankyou, we will be in touch within 24 hours.</span>';
};
};
?>