dbldee Posted August 2, 2008 Share Posted August 2, 2008 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 Link to comment https://forums.phpfreaks.com/topic/117833-some-help-needed-with-simple-password-reminder-script-script/ Share on other sites More sharing options...
cooldude832 Posted August 2, 2008 Share Posted August 2, 2008 check the line above it to see it is closed. I do not see it in your snippet which makes it difficult to help you. Link to comment https://forums.phpfreaks.com/topic/117833-some-help-needed-with-simple-password-reminder-script-script/#findComment-606076 Share on other sites More sharing options...
dbldee Posted August 2, 2008 Author Share Posted August 2, 2008 Thanks cooldude the lines above are just the opening php tag and class declaration <?php class reminder { var $mailer['from'] = '[email protected]'; Link to comment https://forums.phpfreaks.com/topic/117833-some-help-needed-with-simple-password-reminder-script-script/#findComment-606085 Share on other sites More sharing options...
cooldude832 Posted August 2, 2008 Share Posted August 2, 2008 keep looking up further there is something unclosed the expecting ',' or ';' in /...././members/reminder.php on line 19 usually means that you didn't close a function/variable above Link to comment https://forums.phpfreaks.com/topic/117833-some-help-needed-with-simple-password-reminder-script-script/#findComment-606087 Share on other sites More sharing options...
dbldee Posted August 2, 2008 Author Share Posted August 2, 2008 the only lines above are the open tag and class declaration <?php class reminder { var $mailer['from'] = '[email protected]'; Link to comment https://forums.phpfreaks.com/topic/117833-some-help-needed-with-simple-password-reminder-script-script/#findComment-606333 Share on other sites More sharing options...
cooldude832 Posted August 2, 2008 Share Posted August 2, 2008 that's odd try using this instead <?php class reminder{ var $mailer['from'] = "[email protected]"; ?> See if double quotes does something. Also how can that be line 19 if from what u show it is line 5? Link to comment https://forums.phpfreaks.com/topic/117833-some-help-needed-with-simple-password-reminder-script-script/#findComment-606334 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.