PHP: problem after login on website


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting PHP: problem after login on website
# 1  
Old 03-29-2003
PHP: problem after login on website

I have a auction website i downloaded and when i log in as the admin, i get the following error
Quote:
Fatal error: Call to a member function on a non-object in c:\phpdev\www\geoauctions_lite_103\admin\index.php on line 246

whats wrong. the username and password are correct for the log in. Its trying to run another script called admin_catorgies_class.php . thats what i can see in the php script anyway. here the index.php script. its on this page that i login.

Quote:

include("../config.php");
include("adodb.inc.php");
include("authenticate_class.php");

session_start();

$db = &ADONewConnection('mysql');
//$db = &ADONewConnection('access');
//$db = &ADONewConnection('ado');
//$db = &ADONewConnection('ado_mssql');
//$db = &ADONewConnection('borland_ibase');
//$db = &ADONewConnection('csv');
//$db = &ADONewConnection('db2');
//$db = &ADONewConnection('fbsql');
//$db = &ADONewConnection('firebird');
//$db = &ADONewConnection('ibase');
//$db = &ADONewConnection('informix');
//$db = &ADONewConnection('mssql');
//$db = &ADONewConnection('mysqlt');
//$db = &ADONewConnection('oci8');
//$db = &ADONewConnection('oci8po');
//$db = &ADONewConnection('odbc');
//$db = &ADONewConnection('odbc_mssql');
//$db = &ADONewConnection('odbc_oracle');
//$db = &ADONewConnection('oracle');
//$db = &ADONewConnection('postgres7');
//$db = &ADONewConnection('postgress');
//$db = &ADONewConnection('proxy');
//$db = &ADONewConnection('sqlanywhere');
//$db = &ADONewConnection('sybase');
//$db = &ADONewConnection('vfp');

if (!$db->PConnect($db_host, $db_username, $db_password, $database))
{
echo "could not connect to database";
exit;
}

if (!session_is_registered("auth"))
{
$auth = new Auth();
session_register("auth");
}

if ($auth->level == 1)
{
switch ($a) {

case 1:
//display the add category form
include("admin_categories_class.php");
$admin_category = new Admin_categories();
if (!$admin_category->display_category_form($db,$b,1))
$admin_category->category_error();
break;

case 2:
//insert the new subcategory
include("admin_categories_class.php");
$admin_category = new Admin_categories();
if (!$admin_category->insert_category($db,$b,$c))
$admin_category->category_error();
else
if (!$admin_category->browse($db))
$admin_category->category_error();
break;

case 3:
//display a category
include("admin_categories_class.php");
$admin_category = new Admin_categories();
if (!$admin_category->display_current_category($db,$b))
$admin_category->category_error();
else
if (!$admin_category->browse($db))
$admin_category->category_error();
break;

case 4:
//delete a category
//deletes a category and all categories underneath
//moves all items in any of these categories into the parent category of the intended category to be deleted
include("admin_categories_class.php");
$admin_category = new Admin_categories();
if (($b) && ($c))
{
if (!$admin_category->delete_category($db,$b,$c))
$admin_category->category_error();
else
{
if (!$admin_category->browse($db))
$admin_category->category_error();
}
}
elseif ($b)
{
if (!$admin_category->delete_category_check($db,$b))
$admin_category->category_error();
else
{
if (!$admin_category->browse($db))
$admin_category->category_error();
}
}
else
{
if (!$admin_category->browse($db))
$admin_category->category_error();
}
break;

case 5:
//edit a category
include("admin_categories_class.php");
$admin_category = new Admin_categories();
if ($b)
{
if (!$admin_category->display_category_form($db,$b))
$admin_category->category_error();
}
else
{
if (!$admin_category->browse($db))
$admin_category->category_error();
}
break;

case 6:
//update a category
include("admin_categories_class.php");
$admin_category = new Admin_categories();
if (($b) && ($c))
{
if (!$admin_category->update_category($db,$b,$c))
$admin_category->category_error();
else
if (!$admin_category->browse($db))
$admin_category->category_error();
}
else
{
$admin_category->category_error();
}
break;

case 7:
//browse a category
include("admin_categories_class.php");
$admin_category = new Admin_categories();
if ($b)
{
if (!$admin_category->browse($db,$b))
$admin_category->category_error();
}
else
{
if (!$admin_category->browse($db))
$admin_category->category_error();
}
break;

case 50:
//edit the admin login
if ($b)
{
if (!$auth->update_admin_login($db,$b))
$auth->auth_error();
else
{
include("admin_categories_class.php");
$admin_category = new Admin_categories();
$admin_category->home();
}
}
else
{
if (!$auth->edit_admin_login_form($db))
$auth->auth_error();
}
break;

default:
include("admin_categories_class.php");
$admin_category = new Admin_categories();
$admin_category->home();

} //end of switch
}
elseif ($b)
{
if (!$auth->login($db,$b["username"],$b["password"]))
{
$auth->auth_error();
}
elseif ($auth->level == 1)
{
include("admin_categories_class.php");
$admin_category = new Admin_categories();
$admin_category->home();
}
else
{
$auth->admin_login_form();
}

}
else
{
$auth->admin_login_form();
}
?>

# 2  
Old 03-29-2003
Well, there's gotta be a reason for this, but I'm a little confused. The script you posted has 211 lines in it but the error message says the problem is on line 246...
# 3  
Old 03-30-2003
there was a top part, but it was all comments about the script.
# 4  
Old 03-30-2003
so which line is line 246?
# 5  
Old 03-30-2003
include("admin_categories_class.php");

thats the line i think

it has no problem opening this file!
# 6  
Old 10-01-2003
Then perhaps the error is *in* admin_categories_class.php. I don't really know the windows-version error messaging scheme...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Login problem

Hi Everybody, I am getting following error when am trying to login to my oracle user. su: warning: cannot change directory to /bin/bash: Not a directory -sh: /bin/bash/.profile: Not a directory -bash-3.1$ Please help me how to avoid this message and how to login with normal user login... (1 Reply)
Discussion started by: mastansaheb
1 Replies

2. Programming

Need a tracking PHP Script – “how long people stay on the website?”

I want to know, is there a way to track how long anyone has been logged into website and then insert it up for each time they have logged on. In case, user a logs in for 30 minutes, then later comes back and logs in for an hour, then later comes back and logs in for 50 minutes, Add... (1 Reply)
Discussion started by: AimyThomas
1 Replies

3. Emergency UNIX and Linux Support

Migration of website... PHP/Mysql -which path for DB.php

Hi, I have two websites: website1.com and website2.com I didn't write either but have successfully moved all the files from website1.com to website2.com I (thought) I installed all the correct php modules and website2 is mostly up and running. However, my boss found that when we go to a... (15 Replies)
Discussion started by: Astrocloud
15 Replies

4. Web Development

Request to check:PHP website design help

Hi I have a website name www.gentrepid.org I have all the setting scripts for this website in php now as a research part, I am new to this as I havent done that before. I have to make certain changes in the website Include some icons on the left like "Drugs" when user click on it... (0 Replies)
Discussion started by: manigrover
0 Replies

5. Linux

Login problem

Hi, If i changed my password then i can able to enter into linux box. After some time if i tried then i can able to enter into the same box. I have tried lot of times, But it is not resolved yet. Please advice for this . Error msg : fatal: Timeout before authentication for... (0 Replies)
Discussion started by: Mani_apr08
0 Replies

6. Shell Programming and Scripting

Script to run php script on multiple website domains

Good Day, I have multiple websites on a domain. I am looking for a loop structure that can run each site script. egdomain1/test.php domainx/test.php so on, currently I copy and paste a list of commands but that skips certain commands. Some help would be greatly appreciated. Sergio (3 Replies)
Discussion started by: SergioP
3 Replies

7. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

8. Shell Programming and Scripting

Perl website login and session

Hi, I'm currently working on a perl website, and I would need a system where a few users can login into the administration side of the site. about 5-10 users maximum, all pretty simple. I was thinking of using an .htaccess file and a seperate admin folder on the server. I'm wondering if there... (2 Replies)
Discussion started by: LNC
2 Replies

9. AIX

AIX, Hibernate, Java 1.5 website problem

We have an AIX machine running Tomcat 5.0.28 along with Java 1.5. There are two web application on there however when we start Tomcat and unpack the WAR files only one of the sites work. Then if we remove the working site then the other site starts to work. So it appears that one is taking... (0 Replies)
Discussion started by: coaxis
0 Replies

10. Solaris

Login problem

Hi, I have a sun system. Currently reinstalled the OS. The TP interface is configured as hme0 by default when the OS got installed. I can ping locally. But when I try to login it gives me the belwo error message -- unable to login directly on the console. Please do let me know what could... (5 Replies)
Discussion started by: RajaRC
5 Replies
Login or Register to Ask a Question