Empire of Sports Europe
▓░░▓░░░▓░░▓▓▓░▓░░░▓▓▓░▓▓▓▓▓░░▓▓░░░▓▓░░▓▓▓░░░░░░
▓░▓░▓░░▓░░▓░░░▓░░░▓░░░▓░░░▓░░▓░▓░▓░▓░░▓░░░░░░░░
▓▓░░░▓░▓░░▓▓░░▓░░░▓░░░▓░░░▓░░▓░░▓░░▓░░▓▓▓░░░░░░
▓░░░░░▓▓░░▓░░░▓░░░▓░░░▓░░░▓░░▓░░░░░▓░░▓░░░░░░░░
▓░░░░░░▓░░▓▓▓░▓▓▓░▓▓▓░▓▓▓▓▓░░▓░░░░░▓░░▓▓▓░░░░░░
Hello and welcome to EOS-EU - First English Speaking Fansite of Empire of Sports!
Register to obtain full access to the website.
We hope you will enjoy the portal.

EOS-EU Team


Welcome to the first English Speaking Community FanSite of Empire of Sports :)
 
HomePortalCalendarGalleryFAQSearchMemberlistUsergroupsHOMEPORTALFORUMLog inRegister

Share | 

1pɔɹɐsɥǝɹ


 

 Uploader

View previous topic View next topic Go down 
AuthorMessage
Jo_Oker
Administrator
Administrator
avatar


PostSubject: Uploader   Sat May 18, 2013 8:04 pm

Folder1:items
it's empty folder.

index.php
Code:
<?php
?>
<!DOCTYPE>
<html lang="en">
<head>
   <title>#</title>
   <script type="text/javascript">
   function updatepicture(pic) {
      document.getElementById("image").setAttribute("src", pic);
   }
   </script>
   <style>
   body{
background-color:#66CCFF;
}
input{
background-color:#66CCFF;
color:white;
}
   </style>
</head>
<body>
<center>
<form id="form" method="post" action="upload.php" enctype="multipart/form-data" target="iframe">
   <input type="file" id="file" name="file" />
   <input type="submit" name="submit" id="submit" value="Upload File" />
</form>
<p id="message">Uploaded item will go here.</p>
<img style="min-height: 420; min-width: 500; max-height: 120px;" id="image" /><br /><br />
<iframe style="display: none;" name="iframe"></iframe>
</center>
</body>
</html>

upload.php
Code:
<?php
?>
<?php

if ($_FILES['file']['size'] > 0) {

   if ($_FILES['file']['size'] <= 953600000) {
      if (move_uploaded_file($_FILES['file']['tmp_name'], "items/".$_FILES['file']["name"])) {

         
         ?>
         <script type="text/javascript">
         parent.document.getElementById("message").innerHTML = "";
         parent.document.getElementById("file").value = "";
         window.parent.updatepicture("<?php echo 'items/'.$_FILES['file']["name"]; ?>");
         </script>
         <?php
         
      } else {
         
         ?>
         <script type="text/javascript">
         parent.document.getElementById("message").innerHTML = "<font color='#ff0000'>There was an error uploading your image. Please try again later.</font>";
         </script>         
         <?php
         
      }
   } else {
      
      
      ?>
      <script type="text/javascript">
      parent.document.getElementById("message").innerHTML = "<font color='#ff0000'>Your file is larger than #kb. Please choose a different picture.</font>";
      </script>
      <?php
      
   }
   
}

?>

Back to top Go down
View user profile
 

Uploader

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Photobucket Problems

Permissions in this forum:You cannot reply to topics in this forum
Empire of Sports Europe :: PHP-