The following line:
if (($username != $setusername) || ($password != $setpassword)) {
needs to be changed to some SQL statements which check the username / password against a database. How you populate this data is anyones guess.
A full user registration system would be many lines of code. But, some systems would not need this as registration is via some form of administration. ie: A university wouldn't allow just anyone to register for a course.
Or, you can just use the file system and each user would have a folder. The command file_exists() will allow you to test for a username. A inifile inside each folder can hold user profile details. The command parse_ini_file() can be used to extract data from such a file. You would basiclly write something like:
$profile = parse_ini_file("users/$username/profile.ini");
if ($profile && $profile["password"] == $password) { .....
http://php.net/manual/en/function.parse-ini-file.php
But again, it takes a lot of code to write a user registration system, but this would work on free hostings which dont support mysql.
Other methods in include using a XML file to store user data.
The simplest solution is to just use an array of usernames and passwords, but that would only suit a small group. ie: a band or a special interest club.
There is no one correct simple answer. You just have to code it.