na poczatku dzialal sam upload plikow ( ladowane beda pozniej pliki max do 150kb - word dokumenty max 2-5 stron, pozatym wolal bym aby nei byl prosty dostep do nich dlatego ladowane sa do sql )
skrypt do uploadowania dzialal spisany z tad - co duzo mowic z kadys trzeba sie nauczyc

teraz zaczalem go laczyc z drugim formularzem, wszystko jest ustawione jak obecnie w skrypcie ponizej, jednak otrzymuje przy tym taki blad:
Warning: fread(): supplied argument is not a valid stream resource in C:\AppServ\www\prolinc\project\content\registry\registry.php on line 29
Warning: fclose(): supplied argument is not a valid stream resource in C:\AppServ\www\prolinc\project\content\registry\registry.php on line 31
Error, query failed
jak widad wylaczylem kilka lini - chcialem ustawic wszystko do podstawowego skryptu i wtedy przetestowac jednak rezultat taki sam - wydawalo mi sie ze nie dodalem wiecej jednak musialem cos na mieszac, moze ktos jakas rade zasugerowac ktora pomoze mi w rozwiazaniu
Dzieki
<? include("config.inc.php"); mysql_connect($host,$user,$password); @mysql_select_db($database) or die ("Unable to select database"); if(isset($_POST['upload'])) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; #$firstname=$_POST['firstname']; #$surname=$_POST['surname']; #$address1=$_POST['address1']; #$address2=$_POST['address2']; #$towncity=$_POST['towncity']; #$mobile=$_POST['mobile']; #$nationality=$_POST['nationality']; #$visastatus=$_POST['visastatus']; #$englishlevel=$_POST['englishlevel']; #$interested=$_POST['interested']; #$studentstat=$_POST['studentstat']; #$experience=$_POST['experience']; #$addinfo=$_POST['addinfo']; #$startdate=$_POST['startdate']; $fp = fopen($tmpName, 'r'); $content = fread($fp, $fileSize); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } # $query = "INSERT INTO registry VALUES ('0','".$fileName."','".$fileSize."','".$fileType."','".$content."','".$firstname."','".$surname."','".$address1."','".$address2."','".$towncity."','".$mobile."','".$nationality."','".$visastatus."','".$englishlevel."','".$interested."','".$studentstat."','".$experience."','".$addinfo."','".$added."','".$startdate."')"; $query = "INSERT INTO upload (name, size, type, content ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$content')"; mysql_query($query) or die('Error, query failed'); echo "<br>Thank you for your $fileName uploaded<br>"; } ?> <form action="" method="post" enctype="multipart/form-data" name="uploadform"> <table width="100%" border="0" cellpadding="3" cellspacing="3"> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <tr> <select name="select"> </select> </tr> <tr> <select name="select"> </select> </tr> <tr> <td> <label> <input type="checkbox" name="admin" value="checkbox" /> <label> <input type="checkbox" name="retail" value="checkbox" /> <label> <input type="checkbox" name="beauty" value="checkbox" /> <label> <input type="checkbox" name="promotion" value="checkbox" /> </tr> <tr> </tr> <tr> <td> </td> </tr> <tr> </tr> <tr> </tr> <tr> <td> <p> <label> <input type="radio" name="yes" value="radio" /> Yes</label> <label> <input type="radio" name="no" value="radio" /> No</label> </p> </td> </tr> <tr> <select name="select"> </select> </tr> <tr> <td> <label> </label> </td> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> </table> </form>
witajcie znowu ja sluchajcie znalazlem problem ktory mi siedzi cos jest niby nie tak przy dodawaniu pliku do bazy ;/ wspomoze ktos