Greetings,
after visitor clicks on a button, I am trying to have my code verify that an mysql entry is set to yes then send the logged-in session user’s email address to the email address associated with that record.
Here is what I have put together:
*left out connect info.
<?php
if($_SESSION['id'])
$row = mysql_fetch_assoc(mysql_query("SELECT id,usr,member FROM members WHERE usr='{$_POST['username']}'"));
if($row['usr'])
{
$_SESSION['usr']=$row['usr'];
$_SESSION['member'] = 'yes';
send_mail( '$_SESSION[emailaddress"]',
$_POST['email'],
'Registration System - Your New Password',
'Your password is: '.$email);
?>