[insert_php]
global $wpdb;
$msg = “”;
if(isset($_GET[‘id’]))
{
$results = $wpdb->get_results( ‘SELECT * FROM wp_members Where ID=”‘.DBVarConv($_GET[‘id’]).'”‘);
if(empty($results))
{
$msg = “No Member Details Found!!”;
}
else
{
$qry = “update wp_members SET status=’Approved’, updated='”.date(“Y-m-d”).”‘ Where ID='”.DBVarConv($_GET[‘id’]).”‘”;
$member_reg = $wpdb->query( $qry );
$msg = “Member has been Approved!!”;
wp_mail( $results[0]->email, “CGIF Member Registration Approved”, “Congratulations now you have become a proud member of CGIF!!\n\nYour login details for the same will be:\nUsername:”.$results[0]->username.”\nPassword:”.$results[0]->password.”\n\nRegards,\nCGIF Team”);
//print_r($results);
}
}
else
{
$msg = “No Member Details Found!!”;
}
function DBVarConv($var)
{
return addslashes(html_entity_decode($var,ENT_COMPAT,’UTF-8’));
}
[/insert_php]