- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
<script src=scripts.js></script>
<?
if (isset($remove) && $user1 !="selectuser"): //to remove user from DB
print "Was updated sucsessfully: user '$user1' was removed<br>";
print "<font color=red>If You want to reload this page use <u>our 'Reload' button only</u></font>";
$query="delete from users where login=\"$user1\"";
$result=mysql_query($query);
if (!isset($reloadme) ):
//decremet when registered users removed users.txt
$file_loc="users.txt";
chmod ($file_loc,0755);
$newfile = fopen($file_loc, "r");
$file_contents = fread($newfile, filesize($file_loc));
$file_contents=$file_contents-1; //value contains how many users
$newfile = fopen($file_loc, "w+");
fwrite($newfile, "$file_contents");
fclose($newfile);
chmod ($file_loc,0700); // end of adding data to file
endif;
endif; //end of reloadme
//counting of users
$file_loc = "users.txt";
// chmod ($file_loc,0644);
$whattoread = fopen($file_loc, "r");
$file_contents = fread($whattoread, filesize($file_loc));
fclose($whattoread);
// chmod ($file_loc,0755); // end of adding data to file
//end of counting
$query="select * from users order by id";
$result=mysql_query($query); // for first while
$result1=mysql_query($query); // for second while
print "<table border=1 cellspacing=0 cellpadding=0 bordercolor=#007898><tr><td>"; //external table
print "<table border=0 cellspacing=2 cellpadding=2 width=590><tr><td>
<form action=$PHP_SELF method=post><select name=\"user1\" class=select1><option value=\"selectuser\"> Select user ";
while($row=mysql_fetch_object($result)):
print"<option value=\"$row->login\" style=\"background-color:#FFFFFF;\">$row->login";
endwhile;
print "</select><br>
<input type=hidden name=remove>
<input type=hidden name=show>
<input type=hidden name=admin_login value=$admin_login_compare>"; // to enter one more time to login.php
print "<input type=hidden name=admin_password value=$admin_password_compare>"; // if ($admin_password!=$admin_password_compare) etc....
print "<input type=submit value=\"Remove User\" class=button1></form>";
//reload this page
print "<form action=$PHP_SELF method=post>
<input type=hidden name=show>
<input type=hidden name=admin_login value=$admin_login_compare>"; // to enter one more time to login.php
print "<input type=hidden name=admin_password value=$admin_password_compare>"; // if ($admin_password!=$admin_password_compare) etc....
print "<input type=hidden name=reloadme ><input type=submit value=Reload class=button1></form>";
print "Counter: $file_contents users
</td>";
print "<td>
<table border=1 cellspacing=0 cellpadding=4 bordercolor=#007898><tr><td>ID</td><td>Login</td><td>Password</td><td>Email</td><td>Last visit (Y/M/D)</td></tr></tr>";
while($row=mysql_fetch_object($result1)):
print "<tr>";
print "<td>$row->id</td>";
print "<td><a href=\"javascript:showuserdata('$row->login','$row->address','$row->fax','$row->tel','$row->site')\" title=\"Show about $row->login\">$row->login</td>";
print "<td>$row->password </td>";
print "<td><a href=\"mailto:$row->email\" title=\"Email to $row->login\">$row->email</td>";
print "<td>$row->last_date</td>";
print "</tr>";
endwhile;
print "</table></td></tr></table>";
print " </table>"; //end of external table
print "<br> Click user name to view data about him";
exit;
?>