Hello.
I am using the following piece of code to upload the current file:
"
<body>
<form method="post" action="upload.php" enctype="multipart/form-data">
<input name="userfile[]" type="file">
<input type="submit" value="Upload!!!" >
</form>
</body>
"
and the following php code to upload the files into a directory "file" in the folder that upload script[below] and html files are in:
"
<?php
for($i=0;$i<sizeof($userfile);$i++)
{
if(!$userfile_size[$i])
continue;
$UPLOAD = fopen( $userfile[$i], "r" );
$contents = fread( $UPLOAD,$userfile_size[$i]);
fclose( $UPLOAD );
$SAVEFILE = fopen( "file//".$userfile_name[$i], "wb" );
fwrite( $SAVEFILE, $contents,$userfile_size[$i] );
fclose( $SAVEFILE );
}
echo "Server HaD Receive the Upload Files!";
?>
"
Now, where do I embed the javascript? I am lost here, since I tried it on the php script, and the html file itself and it didn't work but gives a javascript error.
I am not good in javascript, so maybe that's one reason.
Any ideas?