Hello im creating a basic form which will be sent to php file , that will connect to database (the database is mySQL and its running under phpmyadmin on a hosting) now what i cant figure out is that , why always when i submit the form , it lets me download the php file it is sending the form to , it always pops out where to save check.php (its the file im sending the form to) the html and php file are locally in my computer not on the hosting
i have a basic html form with one field and submit button
<form action="submit.php" method="POST">
Name :<br>
<input type="text" name="name">
<br><br>
<input type="submit" value="Submit">
</form>
now the php file (ignore the names of db or user , i was trying it with working ones , this is just an example)
<html>
<body>
<?php
$servername = "example";
$username = "example";
$password = "example";
$dbname = "example";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
mysqli_close($conn);
?>
</body>
</html>
so thats all , i just want to get printed out the message that it has successfuly connected , whats wrong? it just pops out , downloading submit.php