sluchajcie zaczalem skladac formularz do uploadu danych do sql'a
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 failedjak 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"> <td width="34%" valign="top"><div class="regtitle">1. Personal Information
</div></b></td> <td valign="top"><div align="right" class="details">First name
</div></td> <td><input name="firstname" type="text" value="" size="25" maxlength="25" /></td> <td valign="top"><div align="right" class="details">Surname
</div></td> <td><input name="surname" type="text" value="" size="25" maxlength="25" /></td> <td valign="top"><div align="right" class="details">Address1
</div></td> <td><input name="address1" type="text" value="" size="25" maxlength="25" /></td> <td valign="top"><div align="right" class="details">Address2
</div></td> <td><input name="address2" type="text" value="" size="25" maxlength="25" /></td> <td valign="top"><div align="right" class="details">Town/City
</div></td> <td><input name="towncity" type="text" value="" size="25" maxlength="25" /></td> <td valign="top"><div align="right" class="details">Mobile
</div></td> <td><input name="mobile" type="text" value="" size="25" maxlength="25" /></td> <td valign="top"><div align="right" class="details">Nationality
</div></td> <td><input name="nationality" type="text" value="" size="25" maxlength="25" /></td> <td valign="top"><div align="right" class="details">Visa status
</div></td> <td valign="top"><div align="right" class="details">English level
</div></td> <td valign="top"><div align="right" class="details">I'm interested in the following industries
</div></td> <input type="checkbox" name="admin" value="checkbox" /> <input type="checkbox" name="retail" value="checkbox" /> <input type="checkbox" name="beauty" value="checkbox" /> <input type="checkbox" name="promotion" value="checkbox" /> <td valign="top"><div class="regtitle">2. Attache your CV
</div></td> <td valign="top"><div align="right" class="details">Submit your file
</div></td> <input type="hidden" name="MAX_FILE_SIZE" value="2000000"><input name="userfile" type="file" class="box" id="userfile">
<td valign="top"><div class="regtitle">3.Additional information
</div></td> <td valign="top"><div align="right" class="details">How soon can you start
</div></td> <td valign="top"><div align="right">Are you a student
</div></td> <input type="radio" name="yes" value="radio" />
<input type="radio" name="no" value="radio" /> <td valign="top"><div align="right" class="details">Preview experience
</div></td> <td valign="top"><div align="right" class="details">Additional Information
</div></td> <td><input name="upload" type="submit" class="box" id="upload" value=" Submit your CV " /></td>
witajcie znowu ja sluchajcie znalazlem problem ktory mi siedzi cos jest niby nie tak przy dodawaniu pliku do bazy ;/ wspomoze ktos