Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- SESSION_start();
- //$pass = 'Vanphu113@'; // Mat khau de them ip vao file txt
- $file_listip = "@system/.htaccess"; // file txt co nhiem vu them ip
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <title>Kiểm tra IP</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- </head>
- <body>
- <?php
- $fopen_ip = fopen($file_listip, "r");
- while ( !feof($fopen_ip) )
- {
- $read_ip = fgets($fopen_ip,50);
- $ip = explode('allow from', $read_ip);
- $list_ip[] = $ip[1];
- }
- fclose($fopen_ip);
- if ( in_array($_SERVER['REMOTE_ADDR'], $list_ip) ){
- echo "<script>alert('IP của bạn đã được cập nhập sẵn.')</script><center>IP của bạn đã được cập nhập sẵn.</center>";
- }
- else {
- $new_ip = $_SERVER['REMOTE_ADDR'];
- $fp = fopen($file_listip, "a+");
- fputs ($fp, "allow from $new_ip\n");
- fclose($fp);
- echo "<meta http-equiv=refresh content='2; URL=http://hvngroups.net/@system/root/index.php'><script>alert('IP của bạn đã được cập nhập thành công.')</script><center>IP của bạn đã được cập nhập thành công.</center>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement