jd2007 Posted July 18, 2007 Share Posted July 18, 2007 how are uploaded files stored ?...pls show me an example... Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
jd2007 Posted July 18, 2007 Author Share Posted July 18, 2007 thanks, buddy... Quote Link to comment 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 ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.