Current location: Hot Scripts Forums » Programming Languages » PHP » [SOLVED] changing password not working


[SOLVED] changing password not working

Reply
  #1 (permalink)  
Old 08-11-08, 01:58 PM
Beylah Beylah is offline
Newbie Coder
 
Join Date: Mar 2008
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] changing password not working

I am trying to create a "reset" for a password. The coding I have resets all the passwords in that table. Not just of that particular user. What am I doing wrong.

<?php
/*if(!$auth=="ok")
{
header ( "Location:login.html");
exit;
}
*/
$id=="id";

include("config.php");
$connection=mysql_connect($hostname,$user,$pass) or die ("Failed to connect.");
mysql_select_db($dbname,$connection) or die ("Cannot connect to DB");

$uid = "SELECT * FROM test WHERE username='$username'";

$query_uid = "UPDATE test SET password='temp'";

mysql_query($query_uid) or die('Error, query failed');

?>
Reply With Quote
  #2 (permalink)  
Old 08-11-08, 02:25 PM
ianbrind ianbrind is offline
Wannabe Coder
 
Join Date: Jul 2008
Location: Somerset UK!
Posts: 192
Thanks: 0
Thanked 0 Times in 0 Posts
$query_uid = "UPDATE test SET password='temp'";

That is why.

It should be
$query_uid = "UPDATE test SET password='temp' WHERE username='$username'";
Reply With Quote
  #3 (permalink)  
Old 08-11-08, 02:37 PM
Beylah Beylah is offline
Newbie Coder
 
Join Date: Mar 2008
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
thank you that worked wonderfully
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing iframe src property not working in Safari AmberLR JavaScript 1 04-08-09 10:41 AM
[SOLVED] Password protect form submission PhpN00b PHP 2 03-16-08 08:29 AM
Password Problems in VB6 iceiceady Visual Basic 6 03-28-06 03:17 PM
Changing member password problem. Spreegem PHP 5 08-12-04 09:26 PM


All times are GMT -5. The time now is 07:53 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.