Here is my php code
<?php
$link = mysqli_connect('localhost','root','abc','contact');
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if(isset($_POST['submit']))
{
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$to = "agarwalmanya1@gmail.com";
$txt = "Name: ". $fname , " ", $lname;
$txt .= "Email: ". $email;
$txt .= "Mobile No: " .$phone;
$txt .= "Message: " .$message;
mail($to,$subject,$txt);
$query = "INSERT INTO hello(`fname`, `lname`, `email`, `mobile`, `subject`, `message`) VALUES('$fname','$lname','$email','$phone','$subject','$message')";
mysqli_query($link,$query);
}
?>
It was working well previously and then it just stopped working. Any help would be appreciated :)