0){ $msg='* This group already exist'; } } if($_GET['action']=="update") { $gname=mysql_real_escape_string($_POST['gname']); $desct=mysql_real_escape_string($_POST['desct']); $id=base64_decode($_GET['id']); if($gname==''){ $msg='*Please enter group name'; } if($gname!=''){ $uid = $_SESSION['user_id']; if($_FILES['file']['name']!='') { $img=uniqid().$_FILES['file']['name']; move_uploaded_file($_FILES['file']['tmp_name'],"group-icon/$img"); mysql_query("update tbl_friends_group set group_details='$desct',group_name='$gname',group_icon='$img',created_date=now() where group_id='$id'"); $msg="Group updated successfully"; } if($_FILES['file']['name']==''){ mysql_query("update tbl_friends_group set group_details='$desct',group_name='$gname',created_date=now() where group_id='$id'"); $msg="Group updated successfully"; } } } if($_GET['id']!='' && getOwner(base64_decode($_GET['id']))== $_SESSION['user_id']){ $info = getgroup(base64_decode($_GET['id'])); $group_name = $info['group_name']; $group_desct = $info['group_details']; $group_icon = $info['group_icon']; $group_owner = $info['group_owner']; } ?>