hi there, i want something like : <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1"> <label> <input type="text" name="folder_name" id="folder_name" /> </label> <p> <label> <input type="file" name="image_name" id="image_name" /> </label> </p> <p> <label> <input type="submit" name="button" id="button" value="Submit" /> </label> </p> </form> HTML: now when the users submit the folder name and image then that folder name and the selected image name should be inserted into database.... whats the code for this?? any ideas??
If I understand you correctly you're trying to allow the user to insert an image file into your database? You want to use the file input type: <input type="file" name="imgfile"> which allows the user to select a file from their hard drive. You'll then need to check the file is a .jpg, .gif or .png (or whichever files you accept) before uploading to your database. Check out this page: http://blazonry.com/scripting/upload-size.php which should get you started.
i want the user inputted folder name and selected image's name to be stored in the table.... is anybody getting me??
it would be like any other insert into a database.. after image upload, do: mysql_query("INSERT INTO images SET folder_name='$_POST[folder_name]', image_name='$_FILES[image_name][name]'"); or something like that