i have a page for user registration where i a form with a image tag to it.
i want the user to fill the form but as soon as he uploads the image i want the image uploaded to be displayed on the image tag.
Then i want all these form values+image to be stored in the database.
or the form values on database and the image file somewhere on the disk.
i am attaching the screenshot.
I am using MySQl for database. and PHP
here is the page code
Related Article:ajax form upload loading a new page
is a Web Development discussion thread by stacyjoseph that has 1 reply, was last updated 2 months ago and has been tagged with the keywords: codeigniter, ajax, file-upload.
Of course what you described is more complicated than the code provided, but this is not the problem, you can’t upload images through a real AJAX (theory sais that you could using techniques in few browsers) , that is the real problem, you could use iframes and javascript form manipulation (e.g. http://www.openjs.com/articles/ajax/ajax_file_upload/ ) on that or the well know SWFUpload (http://swfupload.org/ ).
Of course what you described is more complicated than the code provided, but this is not the problem, you can’t upload images through a real AJAX (theory sais that you could using techniques in few browsers) , that is the real problem, you could use iframes and javascript form manipulation (e.g. http://www.openjs.com/articles/ajax/ajax_file_upload/ ) on that or the well know SWFUpload (http://swfupload.org/ ).
Thanks mate :D
had to use iframe and blah blah.... http://tutorialzine.com/2011/09/html5-file-upload-jquery-php/
can you look at this page plzzz....
it stores the image i upload in a directory with the original image name....
as i am new to php i cant figure out how to change the image name that gets stored in the directory
or
how to store these images in MYSQL instead of that directory
plzz plzz plzz
The second thing you ask (to save the image in a MySql table) you must have reason to do that. I believe that there are really very few cases that this has a meaning , so few that I wouldn’t recommended it at all. If you insist on that you could google about it …
(e.g. http://bytes.com/topic/php/insights/740327-uploading-files-into-mysql-database-using-php)
The second thing you ask (to save the image in a MySql table) you must have reason to do that. I believe that there are really very few cases that this has a meaning , so few that I wouldn’t recommended it at all. If you insist on that you could google about it …
(e.g. http://bytes.com/topic/php/insights/740327-uploading-files-into-mysql-database-using-php)
You are Amazing man.....Thanks :D
i wanted to save the images of the student along with the other details..
but now i think i should store it on the disk itself.
I did it finally.
I stored the images according to the ""Enrollment No."" of students.... :D
thanks agan bro :D