I'm trying to open up my "index.php" file when I log-in on my website with the correct info but I keep getting errors.

Here's my code:

```
<?php
session_start();
include 'dbase.php';

$uid = $_POST['uid'];
$pwd = $_POST['pwd'];

$sql = "SELECT * FROM user WHERE uid = '$uid' AND pwd = '$pwd'";
$result = $conn->query($sql);

if (!$row = mysqli_fetch_assoc($result))
{
    echo "Your username or password is incorrect!";
}
else 
    {
   echo fgets($index);

}

```