How to approved user from admin panel after registration.
1 After registration admin approved to user from admin apnel.
2 In admin panel we fetch all information related to user in table like id, name, address, email, mobile, password and user status (show link for approved for non approved user and show disapproved for approved users ).
// Code //
<tr>
<td>Name</td>
<td>Email</td>
<td>Address</td>
<td>Mobile Number</td>
<td>Password</td>
<td>Status</td>
<td>delete</td>
</tr>
Php code
<?php
//print_r($_REQUEST);
while($data =mysql_fetch_array($row))
{
?>
<tr>
<td><?php echo $data['name'];?></td>
<td><?php echo $data['email'];?></td>
<td><?php echo $data['address'];?></td>
<td><?php echo $data['mobile'];?></td>
<td><?php echo $data['password'];?></td>
<td><a href="useraccount.php?id=<?php echo $data['id']; ?>&status=<?php echo $data['status'];?>">
<input name="statusn" id="statusn" name="statusn" type="button" value="<?php if($data['status']==1){echo 'NotApproved';} else { echo 'Approved'; } ?>" > </a></td>
Add the condition in starting
<?php
include "config.php";
if(isset($_REQUEST['id']) && !empty($_REQUEST['id']) )
{
if($_REQUEST['status']==1)
{$status='0';
}
else
{
$status='1';
}
$sql1= "UPDATE `user` SET `status` = '".$status."' WHERE `user`.`id` = '".$_REQUEST['id']."';";
$run=mysql_query($sql1);
}
$sql = "select * from user";
$row=mysql_query($sql);
?>
Comments
Post a Comment