John Dunlop <usenet+2004@john.dunlop.name> wrote in message news:<MPG.1aebce64dc980b9d9896f6@News.Individual.N ET>...[color=blue]
> Simon wrote:
>[color=green]
> > The first thing is does the html and php go on the same file as a .php
> > file or two seperate files.[/color]
>
> Up to you.
>
> [ ... ]
>[color=green]
> > **Filename: <input type="text" size=40 name="filename"><br>[/color]
>
> What's this for? You've already got:
>[color=green]
> > **<input type="file" size=40 name="file"><br>[/color]
>
> which allows the user to select files.
>[color=green]
> > **<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">[/color]
>
> Mostly useless.
>[color=green]
> > **<input type="submit" value="**********************************Upload
> > *********************************">[/color]
>
> Browsers might ignore that leading and trailing whitespace. Got a
> good reason for including it? If not, remove it.
>[color=green]
> > </form>
> > <?php
> > if*($file*==*""*||*$file*==*"none")*{[/color]
>
> You didn't copy 'n paste this from the Manual, did you?
>
>
http://www.php.net/manual/en/features.file-upload.php[/color]
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="multipart/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_FILES 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