All pastes #542771 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-05 22:31 UTC
rendered paste body
<?php $maxsize=28480; //set the max upload size in bytes
if (!$HTTP_POST_VARS['submit']) {
  //print_r($HTTP_POST_FILES);
  $error = " ";
//this will cause the rest of the processing to be skipped
//and the upload form displays
if ($is_upload_file($HTTP_POST_FILES['upload_file']['tmp_name']) AND
!isset($error)) {
  $error = "<b>You must upload a file!</b><br><br>";
  unlink($HTTP_POST_FILES['upload_file']['tmp_name']);
}
if ($HTTP_POST_FILES['upload_file']['size'] > $maxsize AND !isset($error)) {
  $error = "<b>Error, file must be less then $maxsize bytes</b><br><br>";
  unlink($HTTP_POST_FILES['upload_file']['tmp_name']);
}
if($HTTP_POST_FILES['upload_file']['type'] != "image/gif" AND
$HTTP_POST_FILES['upload_file']['type'] != "image/pjpeg" AND
$HTTP_POST_FILES['upload_file']['type'] != "image/jpeg" AND !isset($error)) {
$error = "<b>You many only upload .gif or .jpeg files.</b><br><br>
unlink($HTTP_POST_FILES['upload_file']['tmp_name']);
}
if (!isset($error)) {
copy($HTTP_POST_FILES['upload_file']['tmp_name'],"uploads/".$HTTP_POST_FILES['upload_file']['name']);
  unlink($HTTP_POST_FILES['upload_file']['tmp_name']);
  print "Thank you for your upload.";
  exit;
}
else
{
  echo ("$error");
}
?>

<html>
<head>
<title>Upload Your Funny Photos/Movies/Songs Here</title>
</head>
<body>
<form action="<?=$PHP_SELF?>" method="post" enctype="multipart/form-data">
Choose a file to upload:<br>
<input type="file" name="upload_file" size="80">
<br>
<input type="submit" name="usubmit" value="submit">
</form>
</body>
</html>

<!-- END OF THE PAGE -->
I GET THIS ERROR
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/steven/public_html/upload.php on line 20


the website it is on is   http://www.steven10172.xenweb.net/upload.php