Spudhead
04-04-2007, 03:58 PM
I've inherited a half-started intranet. Great. It's in PHP and I'm an ASP programmer. If I have to remember to stop putting "then" on the end of IF statements once more, I'm going to hit something.
Anyway. Two questions, from the following code:
require_once('inc/Sentry.php');
$theSentry = new Sentry();
if (!$theSentry->checkLogin(2) ){ header("Location: index.php"); die(); }
There are two things here I can't fathom. One is the -> notation. I can't find a reference to it on www.php.net, although I daresay there is if you're not an idiot. I'm assuming that it simply means "call a function of the parent class", similar to the "." in JS or VBscript?
The second is the function itself. It's defined in Sentry.php as:
function checkLogin($user = '',$pass = '',$group = 10,$goodRedirect = '',$badRedirect = ''){
Which... I'm guessing... means a function with 5 arguments, all of which have default values if they're not sent in the function call. But I still don't get how checkLogin(2) would work. Is that what it's doing? Just calling the function with one argument? How??
Anyway. Two questions, from the following code:
require_once('inc/Sentry.php');
$theSentry = new Sentry();
if (!$theSentry->checkLogin(2) ){ header("Location: index.php"); die(); }
There are two things here I can't fathom. One is the -> notation. I can't find a reference to it on www.php.net, although I daresay there is if you're not an idiot. I'm assuming that it simply means "call a function of the parent class", similar to the "." in JS or VBscript?
The second is the function itself. It's defined in Sentry.php as:
function checkLogin($user = '',$pass = '',$group = 10,$goodRedirect = '',$badRedirect = ''){
Which... I'm guessing... means a function with 5 arguments, all of which have default values if they're not sent in the function call. But I still don't get how checkLogin(2) would work. Is that what it's doing? Just calling the function with one argument? How??