ik heb dit script:
als ik dan na de pagina toe ga in IE krijg ik dit:
hoe post ik dit zonder de layout te vernagelen??
PHP:
1
| <? /* upload.php */ if ($submit) { /* als er op de submit knop is gedrukt */ if ($HTTP_POST_FILES[file][tmp_name] != "none") { /* het bestand mag uiteraard niet leeg zijn */ $fp = @fopen($HTTP_POST_FILES[file][tmp_name],"r"); /* poging tot openen van het bestand */ if ($fp) { /* als het openen is gelukt */ $content = fread($fp,filesize($HTTP_POST_FILES[file][tmp_name])); /* eerst de inhoud van t bestand uitlezen */ fclose($fp); /* bestand sluiten */ $db = @mysql_connect("localhost","user","password") or Die(mysql_error());/* database connexie openen */ @mysql_select_db("database_naam",$db) or Die("Error: " . mysql_error()); /* database selecteren */ $sql = "INSERT INTO images VALUES(0,'" . $HTTP_POST_FILES[file][name] . "','" . $HTTP_POST_FILES[file][type] . "','" . filesize($HTTP_POST_FILES[file][tmp_name]) . "','" . addslashes($content) . "')"; @mysql_query($sql,$db) or Die(mysql_error()); /* en query uitvoeren */ mysql_close($db); print "Bestand opgeslagen"; } else { /* als het bestand niet geopend kan worden, dus !$fp */ print "Kan bestand niet openen"; } } else { print "Geen bestand geselecteerd!"; } } else { ?> <!-- dit is de form die mensen te zien krijgen wanneer ze op upload.php komen --> <html> <head> <title>Upload File</title> </head> <body> <form action="upload.php" method="POST" enctype="multipart/form-data"> Bestand: <input type="file" name="file">&nbsp;<input type="submit" name="submit" value="Upload"> </form> </body> <? } ?> ?> |
als ik dan na de pagina toe ga in IE krijg ik dit:
in de errorlog staat:Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, C001JU135@hotmail.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
ik snap er geen drol van, heb al vele malen gezocht op de sites van php en mysql en met google, maar volgens die sites is het script gewoon goed, wat doe ik fout ?[Mon Mar 18 11:20:50 2002] [info] Parent: Created child process 864
[Mon Mar 18 11:20:50 2002] [info] Parent: Duplicating socket 220 and sending it to child process 864
[Mon Mar 18 11:20:50 2002] [info] BytesRead = 372 WSAProtocolInfo = 2006620
[Mon Mar 18 11:21:18 2002] [error] [client 127.0.0.1] Premature end of script headers: c:/apache/php/php.exe
hoe post ik dit zonder de layout te vernagelen??