Classes Confusion
Posted: Wed Apr 16, 2008 12:49 pm
Ok, I was trying to learn how to do classes and was using this tutorial: http://www.spoono.com/php/tutorials/tutorial.php?id=27
can someone look over its codes because i can't get anything to work...
This is what I came up with so far...
I want to pass the $_POST['username'] into the class to check it and everything under the function login
(is that a security risk using it as a class variable before checking it ?)
can someone look over its codes because i can't get anything to work...
This is what I came up with so far...
I want to pass the $_POST['username'] into the class to check it and everything under the function login
(is that a security risk using it as a class variable before checking it ?)
Code: Select all
class master {
var $loginTime = time();
}
class login extends master {
function login($loginUsername, $loginTime) {
$loginText = "result: ".$loginUsername." time: ".$loginTime;
return $loginText;
}
}
$echo = new login($_POST['username']);
echo $echo;