开发者

is it possible to create inner(nested) forms in php

开发者 https://www.devze.com 2023-02-14 07:52 出处:网络
is it possible to create inner( nested ) forms in php in our application i want to upload user details to mysql server including user recent work ( that is image ). image is stored in my uploads fol

is it possible to create inner( nested ) forms in php

in our application i want to upload user details to mysql server including user recent work ( that is image ). image is stored in my uploads folder and the pa开发者_JAVA百科th of that image is stored in my database. that's way i am using inner form to upload image to uploads folder and returns uploaded image path. when the mail form submitted then user details and image path will stored in mysql database this is my idea is it possible or not please give me suggestions...


It is not possible to create nested forms in HTML, the server side language is irrelevant.

You can have multiple submit buttons and use the value of the successful one (i.e. the one that was used to submit the form) to decide if you should accept an image upload and return to the form (repopulated it with the submitted data) or process the other submitted data.


FORMS are part of HTML and not part of PHP at all. And HTML doesn't allow you to have nested FORMS. The best bet, if you want to upload the image and preview before you submit the actual user data would be to use some JS and an IFRAME to simulate nested forms.

An example of what I explained is here : http://www.openjs.com/articles/ajax/ajax_file_upload/

NOTE This is NOT an Ajax file upload (noted in the article too). But this will help you do what you are looking for

0

精彩评论

暂无评论...
验证码 换一张
取 消