John Dunlop <us*********@jo hn.dunlop.name> wrote in message news:<MP******* *************** **@News.Individ ual.NET>...
Simon wrote:
The first thing is does the html and php go on the same file as a .php
file or two seperate files.
Up to you.
[ ... ]
**Filename: <input type="text" size=40 name="filename" ><br>
What's this for? You've already got:
**<input type="file" size=40 name="file"><br >
which allows the user to select files.
**<input type="hidden" name="MAX_FILE_ SIZE" value="10000000 00">
Mostly useless.
**<input type="submit" value="******** *************** ***********Uplo ad
*************** *************** ***">
Browsers might ignore that leading and trailing whitespace. Got a
good reason for including it? If not, remove it.
</form>
<?php
if*($file*==*"" *||*$file*==*"n one")*{
You didn't copy 'n paste this from the Manual, did you?
http://www.php.net/manual/en/features.file-upload.php
Hi Jock
im sorry about that I posted the wrong script. I hope you dont mind
helping with this Ill post the sript from the manual .
<form enctype="multip art/form-data" action="_URL_" method="post">
<input type="hidden" name="MAX_FILE_ SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILE S should be used
instead
// of $_FILES.
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_ file($_FILES['userfile']['tmp_name'], $uploadfile))
{
** print "File is valid, and was successfully uploaded. ";
** print "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 );
}
print "</pre>";
?>
This is the script and form we can work on if you dont mind
I have tried this however nothing appears to find its way to my tmp
directory. can we wittle this down to the bare script.
1 I have checked file uploads are allowed and enabled
2 php is installed on my server yahoo web hosting
3 the html form appears and works a file is selected from the local
disc.
4 press upload and thats it .
5 nothing appears in my tmp directory.
could you script this so it is on one php file only.
Regards
Simon