Location: PHPKode > scripts > Create Your Own Directory > cms/admin/usrrev.php
<!-- This tool is developed by HIOX INDIA.	-->
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$type = $_POST['type'];
$id=$_GET['id'];
$sub=$_GET['sub'];
$update = $_POST['update'];
?>
<style>
.ta{background-color: ffff44;}
.rad{color:green; font-weight:bold; background-color: ffff44;}
table{font-size: 13px; font-family: arial, verdana, san-serif;}
</style>
<script LANGUAGE="JavaScript" src="register.js">
</script>
<script LANGUAGE="JavaScript" src="register.js">
</script>
<?php
include "heade.php";
?>

<table border=0 width=790 cellpadding=0 cellspacing=0 align=center><tr><td>
<table border=0 align=center width=80%><tr><td align=center ><br>
<?php
if($sub=='yes')
	{
		$str="select * from user where UserId like $id";
//echo"$str";
		$result=mysql_query($str,$link);
		if($line = @mysql_fetch_array($result, MYSQL_ASSOC))
   	 	{
		  $id=$line['UserId'];
		  $name=$line['UserName'];
		  $em=$line['email'];
		  $pw=$line['PassWrd'];
		  $ip=$line['ip'];
		  $phoneno=$line['ContactNo'];
  		  $address=$line['Address'];
		  $status=$line['status'];
		}
if($type=="update")
{
	$em = $_POST['email'];
	if($em != "")
		$em = strtolower($em);
	$em1 = $_POST['email1'];
	if($em1 != "")
	  $em = strtolower($em1);
	$name = $_POST['name'];
	$pw = $_POST['passw'];
	$phoneno=$_POST['phoneno'];
	$address=$_POST['address'];
	$status=$_POST['status'];
	$vv = true;
	$pw2=md5($pw);
	}

	$link = @mysql_connect($hostname, $username,$password);
	if($link)
	{
		$dbcon = @mysql_select_db($dbname,$link);
		if($update=='update')
		{
		    	if($name == "" || $pw == "" || $em == "" )
			{
			    echo(" <table width=100% align=center><tr><td>
				<table height =50 widht=400 align=center><tr>
				<td style=\"border:1px red solid; font-size: 15px;\" align=left>
				 There are empty fields.<br> 
				 Please enter proper values in all the fields<br>");
			    echo(" </td></tr></table> </td></tr></table>");
			    $vv = false;
			}
			else
			{
			  $result1 = mysql_query("select email from user where email like '$em'&& UserId != $id",$link);

				$dssd = @mysql_fetch_row($result1);
				$emaile = $dssd[0];

				if($emaile == $em)
				{
				   echo(" <table align=center><tr><td>
					<table bgcolor=#efefef align=center><tr>
					<td style=\"border:1px red solid; font-size: 15px;\" align=center>
					   A user with this email is already present in the database.<br>");
				    echo(" </td></tr></table> </td></tr></table>");
				    $vv = false;	
				}else{
					
				 $q="update user  set UserName='$name',email='$em',status='$status',ContactNo='$phoneno',Address='$address' where UserId like $id";
					//echo"$q";
				 $r=@mysql_query($q,$link);
					
					echo(" <table align=center><tr><td>
					    <table bgcolor=ffffff align=left style=\"padding: 10px;\"><tr><td>
						<td style=\"color: green; padding: 10px; border: 1px red groove; font-size: 15px;\">
						  <br>Review  of User account <strong>$name</strong> is successfully completed<br>");
						  
				    echo(" </td></tr></table> </td></tr></table>");
				}
			}
		}
		
	}
	else
	{
			echo "Internal server LINK error: Please try after some time";
	}
}
if($vv != true){
?>
<table align=center cellspacing=3 cellpadding=3 bgcolor=#f8f8ff width=100%  style="border:0px #DCDCDC solid;">
<tr><td style="color:#114709; font-size: 15px;" align=center>
<b>NEW USER REGISTRATION</b></td></tr>
<tr><td align=center style="color: #000088; font-size: 14px; padding:10px; ">
Enter proper values in all the fields.
<form name=setf method=POST action="usrrev.php?sub=yes&id=<?php echo($id);?>" onsubmit="return check()">
<input name="type" type=hidden value="update">
<table align=center cellspacing=3 cellpadding=3>
<tr><td>Your Name </td><td> <input name="name" value="<?php echo($name); ?>" type=text></td></tr>
<tr><td>Your Email </td><td> <input name="email" value="<?php echo($em); ?>" type=text></td></tr>
<tr><td>Password </td><td> <input name="passw" value="<?php echo($pw); ?>" MAXLENGTH=15 type=password></td></tr>
<tr><td>Your Phone No.</td><td> <input name="phoneno" value="<?php echo($phoneno); ?>" type=text></td></tr>
<tr><td>Your Address </td><td> <input name="address" value="<?php echo($address); ?>" type=text></td></tr>
<tr><td>Status</td><td> 
<select name=status >
<option name=one value=activate>activate</option>
<option name=two value=deactivate>deactivate</option>
</select></td></tr>
<tr><td> IP Address</td><td><input type=text name="ipadd" value="<?php echo($ip); ?>" readonly="true"></td></tr>
<tr><td colspan=2 align=center><input type=hidden name=update value="update"><input type=submit value="Register"></td></tr>
</form>
</td></tr></table>
<script script LANGUAGE="JavaScript">
document.setf.status.selectedIndex="<?php if ($status=='deactivate')
                                            echo '1'; 
							   else 
							   echo '0';
						   ?>";

</script>
<?php
}
?>

</td></tr></table></div>
<tr><td height=10></td></tr>
</td></tr></table>
<!-- This tool is developed by HIOX INDIA.	-->

Return current item: Create Your Own Directory