Re: Function Misbehaving

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I personally would use is_null($url) to test if it was NULL.

isset() is not the weapon of choice for that, imho...

No idea if that will "fix it" as I've never tried to use isset() to
test for NULL and have no idea what it does.

On Wed, November 15, 2006 10:53 am, Programmer wrote:
> The following function is a basic user auth prep procedure for
> multiple
> pages.  If the url desired is different than the default a url is
> supplied.
>
> This function works most of the time flawlessly; except, on some pages
> when
> the url has a value that was passed, the function still thinks url is
> NULL
> until it is used, such as printing it or assigning another variable
> its
> contents.  Another way to eliminate this sporadic problem is to rename
> the
> parameter url to something else, such as url2.  There are no global or
> session vars with the url name.  Why does php think url is null when
> it is
> not, but only fault in this manner part of the time.  Any help would
> be
> appreciated.
>
>
>
> // Code
>
> function Secure_Login($user,$pass,$db,$pg,$url=NULL)
>
>                         {
>
>                                     //print($url);  if I uncomment
> this url
> is no longer null or if I rename url to url2
>
>
>
>                                                 $checkuser =
> is_user($user,$pass,$db);
>
>                                                 if (!$checkuser)
>
>                                                 {
>
>
> Secure_Email($pg);
>
>
>
>
> if(isset($url))
>
>                                                                         {
>
>
>
>
> Go_Page($url);
>
>                                                                         }
>
>                                                                         else
>
>                                                                         {
>
>
> Go_Page("./login.php?login_error=2");
>
>                                                                         }
>
>                                                 }
>
>                         }
>
>
>
>
>
> Jeremy Schreckhise, M.B.A.
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux