On Tue, 16 Apr 2002, Erik Price wrote:
> First of all, try organizing your code using whitespace.  Here is an 
> example of the code, formatted to be a bit easier to read:

Thank you, that was Pine doing some nice formatting tricks of it's own. 

> Now, my first question, is why do you have $userID passed by parameter 
> into the function, and also globalized in the function?  I am trying to 
> understand this function but this seems like a mistake.  You should 
> probably fix this.  Also, I'm not sure what the $db variable is 
> globalized for -- why is it needed?  It isn't used in the function, as 
> far as I can see.

I see the error there and removed the global, I am moving from ASP 
functions to PHP functions and still learning.  I misunderstood the global 
statement considering that I am passing the userID to the function.  

What I am also discovering is I have to use die; to halt execution for 
certain things.  An example, I check to see if a user is still active in 
the system, if they are not I use a header to redirect them to a page that 
tells them they are inactive.  

if ($userActive == 0){
        header ('Location: notice.php');
}

As is it does not work until I do this:

if ($userActive == 0){
        header ('Location: notice.php');
        die;
}

-Scott




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to