Javascript passing a variable to PHP -


this question has answer here:

what i'm trying use below javascript pull php page html. works, need , struggling use javascript send variable php can use mysql send results back.

httprequest("garage-view-default.php", showdefaultimage); function showdefaultimage(widget){     d = document.getelementbyid('garage-view-default');     d.innerhtml = widget; }  function httprequest(url, callback) {     var httpobj = false;     if (typeof xmlhttprequest != 'undefined') {         httpobj = new xmlhttprequest();     } else if (window.activexobject) {         try{             httpobj = new activexobject('msxml2.xmlhttp');         } catch(e) {try{             httpobj = new activexobject('imicrosoft.xmlhttp');         } catch(e) {}     } } if (!httpobj) return; httpobj.onreadystatechange = function() {     if (httpobj.readystate == 4) { // when request complete         callback(httpobj.responsetext);     } }; httpobj.open('get', url, true); httpobj.send(null); } 

you can add value url:

garage-view-default.php?key=value 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -