i want to send an attachment in a form so i used this code .. !
<form id="form1" name="form1" autocomplete="off" enctype="multipart/form-data"
method="post" novalidate action="triprequestexcuton.php">
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
then in triprequestexcuton.php
$form_data=$_POST['form_data'];
$attachment = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
$qry="insert into triprequest values('','". $attachment."');";
$resultop=mysql_query($qry);
but one i check the database i find the fileld like this [BLOB – 0B] !
my problem with 0B !
so how can i fix it ?
The contents of files uploaded with POST over HTTP is not stored in
$_POST, but in another special server variable called$_FILES, with this said you are not doing what you’re supposed to.