Stupid, I know, but...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
SilverMist
Forum Commoner
Posts: 65
Joined: Tue Mar 02, 2004 2:06 pm
Location: Canada
Contact:

Stupid, I know, but...

Post by SilverMist »

Two things...

1) Lost password script. I need one cause I've got like zero ideas about a structure for it, so anyone with any tips, please...
2) Display members. Say my database was mysite_members, how do I get the members to be displayed on members.php in order of ID?

Thanks guys :D
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

1) I can't really answer this because it is situation specific. For example, if you encrypt your passwords in your database then it is impossible to get the original password (not impossible but not worth it). Your best bet is to generate a new password for them.

Althoght that is the best solution, IMHO, it still has some security flaws unless properly taken care of. Usually what I like to do when users register I require them to put in a secret question and a valid email. If the user requests a new password I will redirect them to a page where they input their email address and their secret answer and if both of them match the information in the database I email it to their email.


2) Can be done easily by something like this

Code: Select all

<?php

$sql = "SELECT * FROM `mysite_members` ORDER BY `id`";
$result = mysql_query($sql) or die(mysql_error());

while ($row= mysql_fetch_assoc($result))
{

echo 'username: '.$row['username'].'<br>
        email: '.$row['email'];

}

?>
Post Reply