Hello i am a noob to php and web desing in general,english is not my mother languange so excuse me on my spelling or grammar mistakes.
I am doing a project which is about competitive programing
I have a made a form: http://takmicarskoprogramiranje.comuf.com/kontakt.html
as you see when you send a message,javascript alerts that email has been send but i dont receive it in my email(contact.php is in the same folder,the hosting site has php installed)
Here is the code for the html and php: HTML
<form action="contact.php" method="post">
Your name<br>
<input type ="text" name ="cf_name"><br>
Your e-mail<br>
<input type ="text" name ="cf_email"><br>
Message<br>
<textarea name = "cf_message"></textarea><br>
<input type="submit" value ="Send">
<input type="reset" value="Reset">
</form>
PHP:
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];
$mail_to = 'takmicarsko.programiranje@yahoo.com';
$subject = 'Poruka od posjetioca site '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Message: '.$field_message;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'kontakt.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to takmicarsko.programiranje@yahoo.com');
window.location = 'kontakt.html';
</script>
<?php
}
?>