Code: Select all
<form enctype="multipart/form-data" action="upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
<input type="hidden" name="hid" value="$hid">
Send this file: <input name="$hid" type="file">
<input type="submit" value="Send File">
</form>Code: Select all
<?php
$hid = $_POST['hid'];
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES.
// In PHP earlier then 4.0.3, use copy() and is_uploaded_file() instead of move_uploaded_file
$uploaddir = '/images/';
print "<pre>";
if (move_uploaded_file($_FILES['$hid']['tmp_name'], $uploaddir . $_FILES['$hid']['name'])) {
print "File is valid, and was successfully uploaded. Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
?>Code: Select all
toCode: Select all
for the second block[/size]
What would I have to change in there for this to work? $uploaddir = '/images/'; and on that, can you make it go to another site. I own another site but it doesn't host php, and I dont want to use too much storage on this site... Would that be possible?
Thanks, Dani