php - Can't get the javascript to emulate a post -
php - Can't get the javascript to emulate a post -
i have next javascript
function submitform(formid) { document.forms[formid].submit(); } function submitform_with_value(eleid,ipvalue,formid) { var ele = document.getelementbyid(eleid); ele.value = ipvalue; submitform(formid); }
and phone call onchange event so
submitform_with_value("upload","upload","frmupphoto")
the input's id 'upload
' form id 'frmupphoto
', , expecting value upload in post. works execpt $_post
in php null. $_files
has file details.
what have in post ?
couple of things here:
your $_files variable beingness populated because have form "enctype" attribute set "multipart/form-data" - used file uploads.
the $_post variable gets populated input field's "name" attribute, not "id".
javascript php post submit
Comments
Post a Comment