connected index to db and fixed link to index.php