如何修复PHP中的“无法GET / POST /connectivity.php”错误

I'm trying to make a login system that saves the username and password in an existing SQL database, but keep getting the same PHP error message and can't figure out what's wrong.

I've scoured SO/the internet for similar threads but most of them have been issues with syntax or not filling in the action field or not installing PHP properly. I've checked all of these--I'm using already-written code from a website (for reference, I used all of the exact code on here: http://mrbool.com/how-to-create-a-login-page-with-php-and-mysql/28656) for the sake of functionality. I have cross-checked it a million times against all the SO threads, it seems completely correct with no errors. I also downloaded MAMP and the test.php with the php information works just fine when I enter localhost/test.php in my browser, but I just can't get connectivity.php to do anything but show "Cannot POST /connectivity.php". The system recognizes the correct login information but once I hit the submit button it takes me to that error message.

<?php 

define('DB_HOST', 'localhost'); 
define('DB_NAME', 'practice'); 
define('DB_USER','root'); 
define('DB_PASSWORD',''); 
$con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to 
connect to MySQL: " . mysql_error()); 
$db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to 
MySQL: " . mysql_error()); 

// $ID = $_POST['user']; 
// $Password = $_POST['pass']; 

function SignIn() 
{ 
session_start();
if(!empty($_POST['user'])) //checking the 'user' name which is from 
Sign-In.html, is it empty or does it have some text 
{ 
$query = mysql_query("SELECT * FROM UserName where userName = 
'$_POST[user]' AND pass = '$_POST[pass]'") or die(mysql_error()); 
$row = mysql_fetch_array($query) or die(mysql_error()); 
if(!empty($row['userName']) AND !empty($row['pass'])) 
{ 
    $_SESSION['userName'] = $row['pass']; 
    echo "SUCCESS"; 
} 
 else 
 {  
 echo "PLEASE RETRY"; 
 } 
} 
} 
if(isset($_POST['submit'])) 
{ 

 SignIn();
} 
?>

and the connected HTML file snippet:

<form method="POST" action="connectivity.php"> User <br><input type="text" name="user" size="40"><br> Password <br>
<input type="password" name="pass" size="40"><br> 
<input id="button" type="submit" name="submit" value="Log-In"> </form> 
</fieldset> </div> </body> </html> 

I expected the message of either SUCCESS or PLEASE RETRY to show up but can't get past the error message.