daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Images
  2.     $thisScript = $_SERVER["SCRIPT_FILENAME"];
  3.     $dirName = dirname($thisScript);
  4.     $relative_path = "images/headshots/".$this->id.".jpg";
  5.     $missing_path = "images/headshots/missing.jpg";
  6.     $full_path = $dirName . "/" . $relative_path;
  7.  
  8.     //if(file_exists($relative_path))
  9.     //if(file_exists($_FILES['uploadedfile']['name']))
  10.     if(basename( $_FILES['uploadedfile']['name']) != '' /*and (file_exists($_FILES['uploadedfile']['name']))*/)
  11.     {
  12.             $this->process_headshot_file($relative_path, $full_path);
  13.     }
  14.     else
  15.     {
  16.         //$this->process_headshot_file($missing_path, $full_path);
  17.         $query = "UPDATE hraps SET headshot_filename = '".$_SESSION['missing_headshot_image']."' WHERE id = ".$this->id;
  18.         $result = mydb::cxn()->query($query);
  19.     }
  20.    
  21. if(basename( $_FILES['uploadedfile']['name']) != '')
  22.    
  23. $image = "images/headshots/missing.jpg";
  24. if(file_exists($relative_path)) {
  25.     $image = $relative_path;
  26. }
  27.  
  28. $full_path = $dirName . "/" . $image;
  29. $this->process_headshot_file($image, $full_path);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top