How do you add ausername to a email from database

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   How do you add ausername to a email from database
DirtySnipe
CZ Super Newbie
DirtySnipe has been a member for over 19 year's 19 Year Member
Occupation: Network Administrator
Gender: Male
Website:
Status: Offline
Joined: Feb 28, 2005
0.00 posts per day
Posts: 35
Points: 1,202
   
When i susspend an account it sends an email to the account. But because the accounts on my site use alot of the same email address i need to to add the username to the message within the mail can somone help me as i cannot figure this one out. Here is the code for the suspended mail.


<?php
if (!defined('YA_ADMIN')) { echo "CNBYA admin protection"; exit; }

if (!stristr($_SERVER['SCRIPT_NAME'], "modules.php")) {
    header("Location: ../../../index.php");
    die ();
}
if (!defined('CNBYA')) { echo "CNBYA protection"; exit; }
if (($radminsuper==1) OR ($radminuser==1)) {

    list($email) = $db->sql_fetchrow($db->sql_query("SELECT user_email FROM ".$user_prefix."_users WHERE user_id='$sus_uid'"));
    if ($ya_config['servermail'] == 0) {       
   $message = "$sus_uid has been suspended from $sitename.\r\n";
        if ($suspendreason > "") {
            $suspendreason = stripslashes($suspendreason);
            $message .= "\r\n\r\n"._SUSPENDREASON."\r\n$suspendreason";
        }
        $subject = _ACCTSUSPEND;
        $from  = "From: $adminmail\r\n";
        $from .= "Reply-To: $adminmail\r\n";
        $from .= "Return-Path: $adminmail\r\n";
        mail($email, $subject, $message, $from);
    }
    $db->sql_query("UPDATE ".$user_prefix."_users SET user_level='0', user_active='0' WHERE user_id='$sus_uid'");
    $pagetitle = ": "._USERADMIN." - "._ACCTSUSPEND;
    include("header.php");
    amain();
    echo "<br>\n";
    OpenTable();
    echo "<center><table align='center' border='0' cellpadding='2' cellspacing='2'>\n";
    echo "<form action='modules.php?name=$module_name&file=admin' method='post'>\n";
    if (isset($query)) { echo "<input type='hidden' name='query' value='$query'>\n"; }
    if (isset($min)) { echo "<input type='hidden' name='min' value='$min'>\n"; }
    if (isset($xop)) { echo "<input type='hidden' name='op' value='$xop'>\n"; }
    echo "<tr><td align='center'><b>"._ACCTSUSPEND."</b></td></tr>\n";
    echo "<tr><td align='center'><input type='submit' value='"._RETURN2."'></td></tr>\n";
    echo "</form>\n";
    echo "</table></center>\n";
    CloseTable();
    include("footer.php");

}




Back to top Reply with quote
#2   
DirtySnipe
CZ Super Newbie
DirtySnipe has been a member for over 19 year's 19 Year Member
Occupation: Network Administrator
Gender: Male
Website:
Status: Offline
Joined: Feb 28, 2005
0.00 posts per day
Posts: 35
Points: 1,202
   
sorted it dunno if i done it properly but i bodged it an it works.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum