Fimeral Posted December 13, 2006 Share Posted December 13, 2006 functions[code]function snifDoc(lyr){ if(document.all) { return document.all[lyr]; } else if(document.getElementById) { return document.getElementById(lyr); } else if(document.layers) { return document.layers[lyr]; }}function makeRequest(){ if(window.XMLHttpRequest) { req = new XMLHttpRequest(); if (req.overrideMimeType) { req.overrideMimeType('text/xml'); } } else if(window.ActiveXObject){ try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} } } else { req = false; } return req;}function yolla(frm, url, lyr){ str = ""; for(i=0;i<document.forms[frm].elements.length;i++) { if(document.forms[frm].elements[i].name) { str += document.forms[frm].elements[i].name +"="+ document.forms[frm].elements[i].value+"&"; } } if(req = makeRequest()) { req.onreadystatechange = function () { switch(req.readyState) { case 4: if(req.status == 200) { snifDoc(lyr).innerHTML = "Başarıyla Değiştirildi"; } else { snifDoc(lyr).innerHTML = 'İşlem başarısız!'; } break; } // END switch } req.open('POST', url, true); req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); req.send(str); }}[/code]and html form[code]<form name='namechange' onsubmit='return false;'> <input type='text' name='ftpname' value='$row[1]' /> <input type='hidden' name='id' value='$row[0]' /> <input type='submit' value='Gönder' onclick='yolla('namechange', 'name_change.php', 'warn');' /> </form>[/code]what is wrong with these codes? :( Link to comment https://forums.phpfreaks.com/topic/30482-ajaxpost-problem/ Share on other sites More sharing options...
ober Posted December 14, 2006 Share Posted December 14, 2006 How about you start by telling us what isn't working right so we don't have to sort through it all?By the way:value='$row[0]' without enclosing that in PHP tags, it's not going to put the value in there. Link to comment https://forums.phpfreaks.com/topic/30482-ajaxpost-problem/#findComment-141181 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.