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
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
Mobile Dev World

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 3 times)
Viewed : 10182
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 Connection/Query Class
Categories : Databases, MySQL, PHP, PHP Classes
Specify your connection settings and create a link to a MySQL database.
Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides
phpFormGenerator for Dynamic Form Generation from MySQL
Categories : PHP, PHP Classes, MySQL, Databases, HTML and PHP
Create and restore backup of MySQL databases
Categories : MySQL, Databases, PHP, PHP Classes, Complete Programs
DBXML- A Class to backup databases in XML Format using web interface
Categories : PHP, PHP Classes, Databases, MySQL, XML
This class splits the results of the query into multiple pages like what the search engine does.
Categories : PHP Classes, PHP, MySQL, Databases
MySQL Class to ease Database connectivity
Categories : MySQL, PHP Classes, Databases, PHP
MySQL database class
Categories : PHP, MySQL, Databases, PHP Classes
TAB_STRUCT Class: Is supporting Class for the DBXML Class
Categories : PHP, PHP Classes, MySQL, XML, Databases
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
Simple database class
Categories : PHP, PHP Classes, MySQL, Databases
Link Manager for Link Exchangers
Categories : PHP, PHP Classes, Databases, MySQL, CURL
PHP Transfer data from text file to Mysql Table
Categories : PHP, PHP Classes, Filesystem, Databases, MySQL