Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Admin Login Script!!Help


dtoft3

Recommended Posts

Hi I hat just installed this "Admin Login" Constribution to protect my admin directory. I fill in the username and password and push "Submit".......then I got this error.

 

What Can I Do?....

 

I Would priciate a answer.

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /*******/****/****/httpd.www/catalog/admin/adminProcesslogin.php on line 13

 

Warning: Cannot add header information - headers already sent by (output started at /*******/****/****/httpd.www/catalog/admin/adminProcesslogin.php:13) in /*******/****/****/httpd.www/catalog/admin/adminProcesslogin.php on line 22

Link to comment
Share on other sites

Warning: Cannot add header information - headers already sent by (output started at /*******/****/****/httpd.www/catalog/admin/adminProcesslogin.php:13)
this is usually a sign of whitespace in the file.

 

download the file catalog/admin/adminProcesslogin.php in order to edit it offline as the online file manager can cause errors when being used to edit files.

 

with the file downloaded and open for edit place your curser after the last ?> and hit delete several times in order to remove the whitespace or blank line, then save and upload.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Thx 241! But it still won't work...

 

adminProcesslogin.php is looking like this

 

<?php

session_start ();

 

// include server parameters

  require('includes/configure.php');

 

// Open MySQL Connection

$Connection=mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD);

 

// Run The Query Without a Limit to get Total result

$SQL="SELECT * FROM Admin WHERE Login = '".strtolower($Login)."' and Password = '".$Password."'";

$SQL_Result=mysql_db_query(DB_DATABASE, $SQL);

$SQL_Rows=mysql_num_rows($SQL_Result);

 

// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less

if ($SQL_Rows > 0) {

$_SESSION['IsAdminLoggedIn'] = 1;

header("Location: configuration.php");

} else {

$_SESSION['IsAdminLoggedIn'] = 0;

header("Location: adminLogin.php?ALE=1");

}

?>

:(

Link to comment
Share on other sites

yes, same error here. I tried both or the contribution versions posted. One needs the config file set to the database details, the othere doesn't I gathered.

 

Is there another way to have a login for admin. Seems VerY scary not having one!!!

 

Best wishes to ALL

 

mark lamb

Edited by mlamb
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
Try to change in adminProcesslogin.php in:

 

$SQL="SELECT * FROM Admin WHERE Login = '".strtolower($Login)."' and Password = '".$Password."'";

 

 

from Admin to admin (small a!)

 

(or in the admin.sql should be changed to Admin prior dump!)

 

 

That did the trick! Thanks B)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...