upload images, doesnt work

Im Trying to uploading a picture in a db, but when I check if it was uploaded, the field is empty. I also want to limit upload file type format jpeg, png and gif. Help please HTML\[code\]<form enctype="multipart/form-data" action="subePic.php" method="post" name="changer"> <input name="MAX_FILE_SIZE" value="http://stackoverflow.com/questions/15861950/102400" type="hidden"> <input name="image" accept="image/jpeg" type="file"> <input value="http://stackoverflow.com/questions/15861950/Submit" type="submit"></form>\[/code\]PHP\[code\]<?phprequire('conecta.php');if (isset($_FILES['image']) && $_FILES['image']['size'] > 0) { $tmpName = $_FILES['image']['tmp_name']; $fp = fopen($tmpName, 'r'); $data = http://stackoverflow.com/questions/15861950/fread($fp, filesize($tmpName)); $data = addslashes($data); fclose($fp); $xSQL ="INSERT INTO FOTOS (PIC) VALUES(?)"; $stmt = $oConni->prepare($xSQL); $stmt->bind_param('s', $data); $stmt->execute() or die($oConni->error); $stmt->close(); if(!$xSQL){ die("Database query failed: ". mysql_error()); } print "Su foto fue subida con
 
Back
Top