hello all,
i had a page where we can see list of users and there is an option to edit them. So when we click on edit button a popup with lightbox comes and now when i edit it and press update... nothing is updating. The reason is i need to post it to same page.but if i do like that my popup is cuming like parent window..so can anyone suggest me..
here is the code of popup lightbox.
<?php
$rno=$_GET[q];
//echo $rno;
include 'dbconnect.php';
$sql="SELECT * FROM reg_users WHERE u_id= '$rno'";
$result=mysql_query($sql);
mysql_error();
//$num=mysql_num_rows($result);
$f1=mysql_result($result,$i,"u_id");
$f2=mysql_result($result,$i,"u_name");
$f3=mysql_result($result,$i,"u_password");
?>
<html>
<head>
<form action="" method="post">
<body>
<table align="center">
<tr>
<td align="right">
<a href="javascript:TINY.box.hide()"> close </a>
</td>
</tr>
<tr>
<td align="left">
<b>Username:</b> <input type="text" name="username" value="<?php echo $f2; ?>">
</td>
</tr>
<tr>
<td>
<b> Password:</b> <input type="text" name="password" value="<?php echo $f3; ?>">
</td>
</tr>
<tr>
<td align="center">
<input style="background-color:#F6E3CE ;" type="submit" name="update" value="Update">
<input style="background-color:#F6E3CE;" type="submit" name="delete" value="Delete">
</td>
</tr></table>
</body>
</form>
</head>
</html>
<?php
include 'dbconnect.php';
if( $_POST['update'])
{
$sql="update reg_users set u_name='$username',u_password='$password' where u_id='$rno'";
$result=mysql_query($sql);
mysql_error();
}
if( $_POST['delete'])
{
$sql="delete from reg_users where u_id='$rno'";
$result=mysql_query($sql);
mysql_error();
}
?>