dfowler Posted January 14, 2008 Share Posted January 14, 2008 Hey everybody. This is a two part question. I have never actually had to deal with this before, and I have read through several topics about this here. It seems consensus for the best option when dealing with images is to save them on the server, then have the file location in the database. Here is what I am trying to do. Upload A user can create a record that includes a name and a description about themselves then has the option to upload an image. Then when they submit the image is uploaded and kept in a directory while the image location is uploaded (along with the name and description) to a database. (I have the form created right now minus the image part): <form action="addM2.php" method="POST"> <table> <tr> <td>Name: <input type="text" name="name" /></td> </tr> <tr> <td>Description</td> </tr> <tr> <td><textarea name="description"></textarea></td> </tr> <tr> <td><input type="submit" value="Submit" /><input type="reset" value="Clear" /></td> </tr> </table></form> <?php include '../system.php'; $name = $_POST['name']; $description = $_POST['description']; $SQL = "INSERT INTO table set name='$name', description='$description'"; mysql_query($SQL); print "Meal successfully added!"; ?> Display To display everything I want a page where the name (in a checkbox) and a thumbnail of the image are pulled dynamically and displayed. This will give a user the option to pick who they want to hear more about. However, if there are no images it still displays all the names (in checkboxes). Once again, minus the image part I think I can do this. Any help would be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/85969-images-uploadingdisplaying/ Share on other sites More sharing options...
Stooney Posted January 14, 2008 Share Posted January 14, 2008 This should be more than enough to get you started with file uploads.http://us2.php.net/features.file-upload Quote Link to comment https://forums.phpfreaks.com/topic/85969-images-uploadingdisplaying/#findComment-438948 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.