What's wrong with this code? Someone knows what happens here?
Warnings:
Warning: Supplied argument is not a valid File-Handle resource in c:\apache\htdocs\scripts\balhiweb.php on line 33
Warning: Supplied argument is not a valid File-Handle resource in c:\apache\htdocs\scripts\balhiweb.php on line 36
My server is on another machine (same LAN). The user must choose a file and the server should show it (this part is not here). T warnings are in lines:
$file_contents = fread( $filename, filesize( $uploadfilechuva ));
and
fclose( $filename );
Thanks for any help.PHP Code:<HTML>
<HEAD>
<TITLE>BalHiWEB 0.1 :: Mais um produto com a qualidade Embrajara!</TITLE>
</HEAD>
<BODY>
<?php
if( $submit )
{
if (($filename = fopen( $uploadfilechuva, "r" ) == FALSE ))
{
print( "Erro ao abrir arquivo!" );
exit();
}
$file_contents = fread( $filename, filesize( $uploadfilechuva ));
fclose( $filename );
?>
<FORM ACTION="<?php echo($PHP_SELF) ; ?>"
METHOD=POST ENCTYPE="multipart/form-data">
<P>Selecione o arquivo de chuvas:<BR>
<INPUT TYPE=FILE NAME="uploadfilechuva">
<INPUT TYPE=SUBMIT NAME="submit" VALUE="submeter"></P>
<INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=1048576>
</FORM>
</BODY>
</HTML>





Bookmarks