Alright, this is my main code:
require \"checkpassword.php\";
require \"mysqllogininfo.php\";
# Validate password
if (!validatePassword($_GET[\"password\"])
No where in your MySQLLoginInfo
constructor do you actually set the class variables, only the local function variables:
#Loop through lines
while (($line = fgets($handle)) !== false) {
if ($i === 0)
$this->host = $line; // vs $host = $line;
// ...
}
I refer you to the documentation on Class Properties:
Within class methods non-static properties may be accessed by using
->
(Object Operator):$this->property
(where property is the name of the property). Static properties are accessed by using the :: (Double Colon):self::$property
. See Static Keyword for more information on the difference between static and non-static properties.