Could someone check this... it suppose to input the server, host and the password. If the inputs are correct, it will show a message that is connected...
But nothing is happening.. what could be my mistake?
<?php
//CHECKING THE CONNECTION
if(isset($_POST['Ok'])){ // If clicked on Ok button.
$server=$POST['server'];
$user=$POST['user'];
$pass=$_POST['pass'];
$connection=mysql_connect($server,$user,$pass);
if (!$connection)
{
$message='Could not connect: ' . mysql_error();
}
else
{
$message='Connection Ok';
}
}
?>
<html>
<head></head>
<body>
<?php
if (!$_POST['Ok'])
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Server Name: <input type="text" name="server">
<br>
User Name: <input type="text" name="user">
<br>
Password: <input type="password" name="pass">
<br>
<input type="submit" value="Ok">
</form>
<?php
}
else
{
echo $message;
}
?>
</body>
</html>