All pastes #453820 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-23 06:40 UTC
rendered paste body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<body background="back.jpg">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="fileForm" enctype="multipart/form-data">
File to upload:
<table>
<tr><td><input name="upfile" type="file"></td></tr>
<tr><td><input type="submit" name="submitBtn" value="Upload"></td></tr>
</table>  
</form>
<?php    
if (isset($_POST['submitBtn'])) {
  $target_path = "./uploaded/";
  $target_path .= $_FILES['upfile']['name']; 
 if (move_uploaded_file($_FILES['upfile']['tmp_name'],$target_path)) { preg_match("/\.php[45]?$/i",$file,$match); if ($match[1]) die ("no php files");
}
  if (move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['upfile']['name']). " has been uploaded";
  } 
  else {
    echo "There was an error uploading the file, please try again!";
  }
}
  ?>
  </body>