You are here: Help! Basic code problem « PHP Programming Language « IT news, forums, messages
Help! Basic code problem

Posted by Big Moxy on 08/11/07 02:18

This is stupid but I don't see the problem. I get a blank page when I
submit this form. The files that I am using for testing are all less
than 50 KB in size.

Any insight is appreciated!!

<form enctype="multipart/form-data" action="image_upload.php"
method="POST">
<table width="100%" border="0" cellpadding="3">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><!-- The data encoding type, enctype, MUST be specified as
below -->
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="50000" />
<!-- Name of input element determines name in $_FILES array -->
Choose a file to upload:
<input name="userfile" type="file" size="40" />
</td>
</tr>
<tr>
<td align="center"><input type="submit" name="Submit" id="Submit"
value="Upload" /></td>
</tr>
</table>
</form>

Here is image_upload.php -

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upload Image</title>
</head>
<?php
error_reporting(E_ALL);
$uploaddir = "d:\domains\test.com\wwwroot\casper\uploads\";
$uploadfile = $uploaddir . basename($_FILES["userfile"]["name"]);
if ($_FILES["userfile"]["error"] > 0)
{
echo "Return Code: " . $_FILES["userfile"]["error"] . "<br />";
}
else
{
echo "No errors" . "<br />";
echo $uploaddir . "<br />";
echo $uploadfile . "<br />";
}
?>
<body>
</body>
</html>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация