You are here: $_FILE variables returning null when in body of page. « PHP Programming Language « IT news, forums, messages
$_FILE variables returning null when in body of page.

Posted by bill on 11/24/06 18:44

I am a relative newbie to PHP, but not to other languages.
I wrote a test script to upload files. In the php section above
the page I get the expected content of the $_FILES array.

When I have a php section in the body, the $_FILES array
variables return nothing.
--------here is the page that is the action of the post-------
<?php

echo "The array<br />";
print_r($_FILES);
echo "<br />--------------------------------";
echo "<br />temp-name-php:";
echo $_FILES["test-img"]["tmp_name"];
echo "<br />name-php:";
echo $_FILES["test-img"]["name"];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=us-ascii" />
<title>do test upload</title>
</head>
<body>
<p>test file upload-5</p>

<p><? echo "this is a test <br />" ?>
temp name-> <? echo $_FILES["test-img"]["tmp_name"] ?> <br />
name -> <?php echo $_FILES["test-img"]["name"]; ?> <br />
size -> <?php echo $_FILES["test-img"]["size"]; ?> <br />
type -> <?php echo $_FILES["test-img"]["type"]; ?> <br />
</p>
</body>
</html>
-------------------------------------------------------

Any suggestions as to why I get the null returns from the $_FILE
array ?

 

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

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