actually facing some problems with my php contact form. problem Number 1: After submit the contact form if the user reload the browser they get an message from browser alert
Confirm Form Resubmission
The page that you're looking for used information that you entered. Returning to that page might cause any action you took to be repeated. Do you want to continue?
Continue button and Cancel button
Problem Number 2: after submit the form i'm getting mails on my mailbox but i'm getting it via hostinguser@webserver.com so is that any problem?
here is my all code please make me currect if i'm doing wrong or something like that. thanks
<head>
<title>Form submission</title>
</head>
<body>
<form method="post">
First Name: <input type="text" name="client_name"><br>
Last Name: <input type="text" name="client_phone"><br>
Email: <input type="text" name="email"><br>
Message:<br><textarea rows="5" name="message" cols="30"></textarea><br>
<input type="submit" name="submit" value="Submit">
</form>
<?php
if(isset($_POST['submit'])){
$to = "mailmenow23@gmail.com"; // this is your Email address
$from = $_POST['email']; // this is the sender's Email address
$client_name = $_POST['client_name'];
$client_phone = $_POST['client_phone'];
$subject = "Form Submission by"." " $client_name ;
$message = "Client Name : ". $client_name ."\n\n". "Client Phone : " . $client_phone ."\n\n"." wrote the following:" . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent. Thank you " . $client_name . ", we will contact you shortly.";
}
?>
</body>
</html>```