UBB.Dev
Posted By: Goten Question on addpost.php - 11/30/2000 6:27 PM
In addpost.php , you do

if ($Reged == "y") {
$userob = new user;
$user = $userob -> authenticate("$Username","$Password","U_Username, U_Password$
}

// See if they are banned
$userob -> check_ban($Username);

What if anonymous users are allowed to post? No object define when you go to check_ban() function because $userob = new user; is in the if block.



------
Da PHP programmer

Edited by Goten on 11/30/00 10:28 AM.

Posted By: Muhammad Re: Question on addpost.php - 11/30/2000 6:37 PM
Then ban by IP... right?

Muhammad Chishti
Creative dIRECTOR
[:white]http://www.imcuniverse.com
Posted By: Goten Re: Question on addpost.php - 11/30/2000 6:43 PM
No, I am saying if anonymous users are allowed to post, then $Reged will be equal to "n". Therefore, $userob = new user; will not be execute. If it is not executed, there is no $userob object. When the script hit the line $userob - > check_ban($Username); , a Fatal error will occur due to using a object method which the object does not exist.

------
Da PHP programmer
Posted By: Muhammad Re: Question on addpost.php - 11/30/2000 7:01 PM
Yes, I see, you are correct... []/w3timages/icons/smile.gif[/]

Muhammad Chishti
Creative dIRECTOR
[:white]http://www.imcuniverse.com
Posted By: sclausen Re: Question on addpost.php - 12/01/2000 3:22 AM
I replied to a post as an Anonymous user and got "Fatal error: Call to a member function on a non-object in addpost.php on line 33". Once I logged in the post was fine.

Simon Clausen

Posted By: Rick Re: Question on addpost.php - 12/01/2000 5:06 AM
Working on getting these problems fixed up now.

-------------------
Scream
WWWThreads Developer
© UBB.Developers