Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Call to a member function on a non-object in d:\webservers\www\onlineshop\login.php on line 34


tsvlsr

Recommended Posts

Posted

i'm try to login with mail adress and password

and see this - Fatal error: Call to a member function on a non-object in d:\webservers\www\onlineshop\login.php on line 34

 

were are php listing

// Check if email exists

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");

if (!tep_db_num_rows($check_customer_query)) {

$error = true;

} else {

$check_customer = tep_db_fetch_array($check_customer_query);

// Check that password is good

$passwordgood = tep_validate_password($_POST['password'], $Qcheck->value('customers_password'));

 

if ($password == "setpwdhere" || $password == "setpwdhere2") {

$passwordgood = 1;

} else {

$passwordgood = $passwordgood;

}

 

if (!$passwordgood) {

$error = true;

} else {

 

if (SESSION_RECREATE == 'True') {

tep_session_recreate();

}

 

 

please tell wats wrong?

Posted

i fogot line 34 see below

// Check if email exists

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");

if (!tep_db_num_rows($check_customer_query)) {

$error = true;

} else {

$check_customer = tep_db_fetch_array($check_customer_query);

// Check that password is good (next line is 34)

$passwordgood = tep_validate_password($_POST['password'], $Qcheck->value('customers_password'));

 

if ($password == "setpwdhere" || $password == "setpwdhere2") {

$passwordgood = 1;

} else {

$passwordgood = $passwordgood;

}

 

if (!$passwordgood) {

$error = true;

} else {

 

if (SESSION_RECREATE == 'True') {

tep_session_recreate();

}

Posted

// Check that password is good
$passwordgood = tep_validate_password($_POST['password'], $Qcheck->value('customers_password'));

if ($password == "setpwdhere" || $password == "setpwdhere2") {
$passwordgood = 1;
} else {
$passwordgood = $passwordgood;
}

if (!$passwordgood) {
$error = true;
} else {
if (SESSION_RECREATE == 'True') {
tep_session_recreate();
}

 

Removed the blank line before if (SESSION_RECREATE... See if this works :)

http://www.oscommerce.info/kb/68

 

jon

It's all just ones and zeros....

Posted

i'm trying like that ... but it's wrong code in article

it must looks like that

list new

 

// Check that password is good

$passwordgood = tep_validate_password($password, $check_customer['customers_password']);

if ($password == "some" || $password == "some2") {

$passwordgood = 1;

} else {

$passwordgood = $passwordgood;

}

 

if (!$passwordgood) {

$error = true;

} else {

  • 4 months later...
Posted
i'm trying like that ... but it's wrong code in article

it must looks like that

list new

 

// Check that password is good

$passwordgood = tep_validate_password($password, $check_customer['customers_password']);

if ($password == "some" || $password == "some2") {

$passwordgood = 1;

} else {

$passwordgood = $passwordgood;

}

 

if (!$passwordgood) {

$error = true;

} else {

 

I had the same problem, then on examining the code, realised that the reason it was not working was as outlined above, on line 34, they used:

 

$passwordgood = tep_validate_password($_POST['password'], $Qcheck->value('customers_password'));

 

however, since the password has been retrieved earlier on in the page(line 25) and stored in $password, as well as the customer info stored in $check_customer (see line 32), the right code for line 34 should be:

 

$passwordgood = tep_validate_password($password, $check_customer['customers_password']);

 

check to see that it works... and thanks also to tsvlsr for spotting this.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...