As YAOMK alludes to, it appears whatever editor you are using is applying "smart quotes" to your text. If so, you either need to use a different editor, or else turn off that "smart quote" feature in your editor so that you only use "straight" (or "non-directional") quotes. For example, lines like this...
$username = $_POST[‘username’];
$password = md5($_POST[‘password’]);
$query = “SELECT * FROM users where username=’$username’ and password=’$password’”;
...need to be changed to...
$username = $_POST['username'];
$password = md5($_POST['password']);
$query = "SELECT * FROM users where username='$username' and password='$password'";
I would suggest you use an editor such as Notepad++ or HTML-Kit (or at least just plain old Notepad in Windows) rather than something like MS Word or Wordpad, which are designed for desktop publishing rather than plain text editing.