NorthStarDA
IS-IT--Management
i have a page with a record list on it, the list has links that send the ID back to the page with 'activate' or 'suspend' links. the queries are not performing, yet the die message does not show. here are the links
and here is the relevant part of the code after the link is clicked
appreciate any help
=========================================
I have not failed. I've just found 10,000 ways that won't work.
Thomas A. Edison
Code:
<td nowrap align="center"><?php
if($Row[user_active] == '1')
{
print "<a href=\"subordinates_manage.php?action=suspend&vm_user_id=" . $Row[user_id] . "\" target=\"_self\">Suspend</a>";
}
else
{
print "<a href=\"subordinates_manage.php?action=activate&vm_user_id=" . $Row[user_id] . "\" target=\"_self\">Activate</a>";
}
?></td>
and here is the relevant part of the code after the link is clicked
Code:
if($_GET['action'] == "activate")
{
$new_password = mt_rand(100000, 999999);
$Query = "UPDATE phpbb_users SET phpbb_users.user_active='1', phpbb_users.user_password=MD5('$new_password') WHERE phpbb_users.user_id='$activate[$i]'";
mysql_query($Query) or die("Error in Activate Process. ".mysql_error($Link));
//print $Query;
$Query = "SELECT username, emailaddress FROM vm_users WHERE user_id='".$activate[$i]."'";
$Result = mysql_query($Query) or die("Error in Activate Process. ".mysql_error($Link));
$Row = mysql_fetch_array($Result, MYSQL_ASSOC);
$message = "Your account has been activated by your administrator. Your username is: " . $Row['username'] . " and your password is: " . $new_password . ". Please login to your account and change this default password as soon as possible.";
mail($Row['emailaddress'], "Account activated.", $message);
}
if($_GET['action'] == "suspend")
{
$Query = "UPDATE phpbb_users SET phpbb_users.user_active='0' WHERE phpbb_users.user_id='$suspend[$i]'";
mysql_query($Query) or die("Error in Suspend Process. ".mysql_error($Link));
}
appreciate any help
=========================================
I have not failed. I've just found 10,000 ways that won't work.
Thomas A. Edison