You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 regels
560 B

  1. <?php
  2. include "header.php";
  3. $nom = "map.jpg";
  4. $uploaddir = './medias/'.$hash.'/';
  5. $uploadfile = $uploaddir . basename($nom);
  6. $extensions_valides = array( 'jpg' , 'jpeg' );
  7. $extension_upload = strtolower( substr( strrchr($_FILES['userfile']['name'], '.') ,1) );
  8. if ( in_array($extension_upload,$extensions_valides) ) {
  9. $resultat = move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile);
  10. if ($resultat) header("location:index.php?msg=5");
  11. else {
  12. header("location:index.php?msg=6");
  13. }
  14. }
  15. else {
  16. header("location:index.php?msg=6");
  17. }
  18. ?>