jd2007 Posted July 18, 2007 Share Posted July 18, 2007 how are uploaded files stored ?...pls show me an example... Link to comment https://forums.phpfreaks.com/topic/60536-how-are-uploaded-files-stored/ Share on other sites More sharing options...
DeadEvil Posted July 18, 2007 Share Posted July 18, 2007 Check this out it works for me. <?php include ('db_connect.php'); # Directory / Filenameto be upload $newimage = "Copy_File/image.jpg"; if($_POST['Upload']) { if(empty($_FILES['pic'])) { print "Empty field"; } if(!empty($_FILES['pic'])) { $image = $_FILES['pic']; move_uploaded_file($_FILES['pic']["tmp_name"], $newimage); print "Picture is uploaded!"; $query = mysql_query("INSERT INTO message VALUES('','USER_NAME','MESSAGE','TIME','$newimage')") or die (mysql_error()); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body marginheight="200" marginwidth="300"> <form name="upload" action="<?php $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data"> Upload Image: <input type="file" name="pic" size="15" /> <input type="submit" name="Upload" value="Upload" /> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/60536-how-are-uploaded-files-stored/#findComment-301145 Share on other sites More sharing options...
jd2007 Posted July 18, 2007 Author Share Posted July 18, 2007 thanks, buddy... Link to comment https://forums.phpfreaks.com/topic/60536-how-are-uploaded-files-stored/#findComment-301147 Share on other sites More sharing options...
jd2007 Posted July 18, 2007 Author Share Posted July 18, 2007 how to add you as a contributer ? Link to comment https://forums.phpfreaks.com/topic/60536-how-are-uploaded-files-stored/#findComment-301156 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.