Simple PHP upload problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
danyboy
Forum Newbie
Posts: 2
Joined: Thu Apr 22, 2004 7:14 am

Simple PHP upload problem

Post by danyboy »

Code: Select all

<?php
	echo $POST['file1']['size'];
?>

<form action="test.php" method="POST" enctype="mulipart/form-data">
<input type="file" name="file1">
<br>
<input type="submit" value="Upload">
</form>

Basically - nothing happens - I've copied this code from a book, checked google, asked a friend and still no idea why there is no output from this.

Any help would be greatly appreciated - thanks.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Try:

Code: Select all

<?php 
   echo $_FILES['file1']['size']; 
?> 

<form action="test.php" method="POST" enctype="mulipart/form-data"> 
<input type="file" name="file1"> 
<br> 
<input type="submit" value="Upload"> 
</form>
danyboy
Forum Newbie
Posts: 2
Joined: Thu Apr 22, 2004 7:14 am

Post by danyboy »

erm - nope still no joy

btw - does the first code i wrote work for you?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Try doing:

Code: Select all

echo '<pre>';
print_r($_FILES);
echo '</pre>';
and let us know if you get any output when you submit the page.

Mac
Post Reply