WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Password reminder
Categories : PHP, PHP Classes, Databases, MySQL, Mail Click here to Update Your Picture
leaping langoor
Date : Apr 24th 2005
Grade : 1 of 5 (graded 2 times)
Viewed : 6548
File : No file for this code example.
Images : No Images for this code example.
Search : More code by leaping langoor
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Want a password reminder?
<?php

/*********************************************************
** Class password reminder
**
** Author.: leapinglangoor [ leapinglangoor@yahoo.co.in ]
** Date...: 23rd June 2004
** Version: v2.3
**
** Descreption: Ok, all this class does is use the passed
**           email, $email and send the passwd to the id
**           afer checking it exists.
**
**********************************************************/

class reminder
{

    var
$mailer['from'] = 'someone@somwhere.tld';

    var
$db['host'] = 'localhost';
    var
$db['user'] = 'root';
    var
$db['pass'] = '';
    var
$db['db'] = 'users';

    var
$db['table'] = 'user_info';

    var
$db['field_passwd'] = 'password';    // Specify the name of the field in the table corresponding to the password field.
   
var $db['field_email'] = 'email';    // Same as above only for the email

   
function remind( $email )
    {

        @
mysql_connect( $this->db['host'], $this->db['user'], $this->db['pass'] ) or die( 'Cant connect' );
        @
mysql_select_db( $this->db['db'] ) or die( 'No db' );

       
$sql = "SELECT `$this->db['field_passwd']` FROM `$this->db['table']` WHERE `$this->db['field_email']` = `$email`";

       
$result = mysql_query( $sql ) or die( 'Cant query' );

        if( !
mysql_num_rows( $result ) )
            return
0;

       
mail( $email, 'Password reminder', 'From: ' . $this->mailer['from'] ) or die( 'Cant mail' );

        return
1;
    }
}
// End class reminder
?>



Example.php (*Config the vars in the class first*):

<?php
include( 'reminder.php' );
$rem = new reminder;
$email = 'some@somwehere.tld';
if(
$rem->remind( $email ) )
        echo
'Password successfully sent';
else
    echo
'Email not found in database';
?>



MySQL Handler
Categories : PHP, Databases, MySQL, Classes and Objects, PHP Classes
Powerful php/mysql Pagination for up to 6 URL Params
Categories : PHP, PHP Classes, Databases, MySQL, Navigation
PostGreSQL and MySQL 2 in 1 db Manager
Categories : PHP, PHP Classes, Databases, PostgreSQL, MySQL
MySQL Class to ease Database connectivity
Categories : MySQL, PHP Classes, Databases, PHP
usercounter class
Categories : PHP, PHP Classes, Databases, MySQL, Environment Variables
Simple Mini Poll class library (SimPoll)
Categories : PHP, PHP Classes, Databases, MySQL, Complete Programs
Online Automatic Class Generator for MySQL Tables
Categories : PHP, PHP Classes, Classes and Objects, Databases, MySQL
Simple database class
Categories : PHP, PHP Classes, MySQL, Databases
Simple usersOnline class - keep track of how many users are online on your site
Categories : PHP, PHP Classes, Databases, MySQL
Specify your connection settings and create a link to a MySQL database.
Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides
Setting up InnoDB on MySQL and using Transactions Begin, Commit, Rollback in PHP.
Categories : PHP Classes, Databases, PHP, MySQL, InnoDB
Ajax PHP Tree (Left and Right) with MySQL
Categories : PHP, Databases, MySQL, AJAX, PHP Classes
YellowPages Content Grabber (PHP5 +)
Categories : PHP, PHP Classes, Regexps, Databases, MySQL
Convert SQL from oracle,mysql,mssql,sqlite and odbc to SQL compatible
Categories : PHP, PHP Classes, Databases, MySQL, MS SQL Server
MySQL Connection/Query Class
Categories : Databases, MySQL, PHP, PHP Classes