PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 26th, 2002, 05:31 PM
chinni chinni is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 58 chinni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
How to change the password

Hello,

I have a log-in page where the user name and password entered is checked with the values in a table and if they match, the user would be re-directed to the page i mentioned in the header.Thatz fine.Now, i would like to change the password through a form.For ex:

I have a form with 3 text boxes to enter the old password(i.e the user which he entered to log-in), to enter a new password and to re-enter the new password.If the entered new password and the re-entered password matches they are stored in the table in encrypted form.If they are not matched, i would like to display an error message.I would like to store this newly entered password value on my old password, that is just over-writing the exsisting one.How can i do this one?
All your suggestions would be highly appreciated.

thanking you in advance.


The following is the piece of code which i'm using for my log-in page.


<?php

Database connection;

$sql = "SELECT count(*) as cnt from TBL_USER WHERE USER_NAME = '$user' AND USER_PASSWORD = '$pass'";
$result = ibase_query($sql);
$row = ibase_fetch_row($result);
if ($row[0]) {
header('Location: main.php');
exit;
} else {
echo"<form action="$PHP_SELF" method="POST">n";

}
// Display Log-in Form
?>


Reply With Quote
  #2  
Old August 27th, 2002, 04:26 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: How to change the password

u can use the same code to check if old pass was right, and to actualy change a pass to a newpass, try with a query like:

php Code:
Original - php Code
  1.  
  2. $sql="UPDATE tbl_user SET user_password='$newpass' WHERE user_name='$user' AND user_password='$oldpass' ";
  3.  
  4. $result=ibase_query($sql);


Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > How to change the password


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway