Hi,
 
cfg: w2k, Apache 1.3, php4.11, Mysql 3-23-40-max-nt
 
I'm using following code to insert images (gif, jpg) into table. Everything
worked fine until I switch to php4.11. Now this code is inserting only image
header or something similar.
BTW: pct_data  is   longblob !!!
 
Thank you for any help !!
 
Dan

<?
if ($submit) {
    mysql_connect( "****", "*****", "********");
    mysql_select_db( "****");
    $data = addslashes(fread(fopen($form_data,  "r"),
filesize($form_data)));
    $size = GetImageSize ($form_data);
    $result = mysql_query("INSERT INTO pictures VALUES
(0,'$data','$form_data_type','$size[0]','$size[1]')");
    $id = mysql_insert_id();
    print  "<p>this file has the following database id: <b>$id</b>";
    mysql_close();
} else {
?>
 <form method="POST" action="<?$PHP_SELF;?>" enctype="multipart/form-data">
 <input type="hidden" name="max_file_size" value="1000000">
 <br>Meno súboru :<br>
 <input type="file" name="form_data"  size="40">
 <p><input type="submit" name="submit" value="submit">
 </form>
<?
}
?>

Reply via email to