Jump to content

Some help needed with simple password reminder script script


dbldee

Recommended Posts

Info is reteived from mySql DB

class reminder 
{ 

    var $mailer['from'] = '[email protected]'; 

    var $db['host'] = 'db.net'; 
    var $db['user'] = 'dbouser'; 
    var $db['pass'] = 'dbpass'; 
    var $db['db'] = 'dbname'; 

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

    var $db['pass'] = 'password';    // Specify the name of the field in the table corresponding to the password field. 
    var $db['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 
?> 



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

 

http://check-for-it.com/powerlistbuilder2/members/reminder.php

 

 

 

results in syntax error

Parse error: syntax error, unexpected '[', expecting ',' or ';' in /...././members/reminder.php on line 19

 

line 19

 

var $mailer['from'] = '[email protected]';

 

Any assistance appreciated

 

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.