Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
SAH1 feature on websites
Old 04-05-2010, 06:39 PM SAH1 feature on websites
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
Hi all,

I need some help i am trying to make a login screen and as faw as I can see my code is ok but it just wont be nice and work

PHP Code:
$unit mysqli_real_escape_string($dbc,trim($_POST['unitName']));
$pass mysqli_real_escape_string($dbc,trim($_POST['passWord']));
$test = (SHA1($pass));

//echo  "$test";
$query "SELECT FROM table_trans WHERE unit='$unit' AND Pass='$test'";
echo
"$query";
$result = @mysqli_query ($query);
                        
$count mysqli_num_rows($result);
if(
$count==1)
{
header("Location: Tic.php" ); 
}else{
                        
$error "The unit name or the password was incorrect please try again";
echo 
"$error";

This the problem I get when I try run the code.

//debuging
SELECT FROM table_trans WHERE unit='test' AND Pass='b4dde37aa2aac745c0e6c43447507eaeace3e59f'

//error
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in C:\wamp\www\login.php on line 28

The unit name of password was incorrect please try again

What I dont get is the unit is test and the SHA1=b4dde37aa2aac745c0e6c43447507eaeace3e59f so it should return 1 and let the user in am I missing somthing?

Thanks in advance
__________________

Please login or register to view this content. Registration is FREE
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
 
Register now for full access!
Old 04-05-2010, 07:00 PM Re: SAH1 feature on websites
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Your query is not returning a result.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-05-2010, 07:01 PM Re: SAH1 feature on websites
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
sorted the problem now was being a retard :P
__________________

Please login or register to view this content. Registration is FREE
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
Old 04-05-2010, 07:03 PM Re: SAH1 feature on websites
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Been there, done that, I keep washing the T-shirt.

__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to SAH1 feature on websites
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20037 seconds with 12 queries