Gayner Posted September 13, 2009 Share Posted September 13, 2009 i want to use this code inside my rofl.php .. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <gt> <status><![CDATA[2]]></status> </gt> my rofl.php: <?php // Load and Start IPB SDK require_once "ipbsdk/ipbsdk_class.inc.php"; $SDK =& new IPBSDK(); global $ibforums; echo $_GET["s"]; mysql_query("UPDATE ibf_members SET s = '". mysql_real_escape_string($_GET["s"]) ."' WHERE id='{$ibforums->member["id"]}'"); ?> how? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 13, 2009 Share Posted September 13, 2009 That's a ruddy good questuin - how do you want to use that code in your rolf.php? Quote Link to comment Share on other sites More sharing options...
Gayner Posted September 13, 2009 Author Share Posted September 13, 2009 That's a ruddy good questuin - how do you want to use that code in your rolf.php? using this: function njAJAX() { this.callback = 0; this.waitingResponse = 0; this.url = ""; this.method = "GET"; this.params = null; this.errorCallback = 0; this.xmlObj = 0; this.getPage = function(pageURL, pageCallback) { if(this.waitingResponse) return; if(pageURL) this.url = pageURL; if(pageCallback) this.callback = pageCallback; try { this.xmlObj = new XMLHttpRequest(); } catch (error) { try { this.xmlObj = new ActiveXObject("Microsoft.XMLHTTP"); } catch (error) { } } if(!this.xmlObj) return; var o = this; this.xmlObj.onreadystatechange = function() { if(o.xmlObj && o.xmlObj.readyState == 4 && o.xmlObj.status == 200) { if(!o.xmlObj.responseXML && o.errorCallback) o.errorCallback(); o.waitingResponse = 0; if(o.callback) o.callback(o); } } this.xmlObj.open(this.method, this.url, true); this.xmlObj.send(this.params); this.waitingResponse = 1; } this.getElementNodeValue = function(eName, eIndex) { var e = this.xmlObj.responseXML.getElementsByTagName(eName); if(!eIndex) eIndex = 0; if(e && e[eIndex] && e[eIndex].childNodes && e[eIndex].childNodes[0]) return e[eIndex].childNodes[0].nodeValue; } } Sir please ? Quote Link to comment Share on other sites More sharing options...
Gayner Posted September 13, 2009 Author Share Posted September 13, 2009 When I go here: /forums/rofl.php?&s=hey I want it to show up: <gt> <status>hey</status> </gt> Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 13, 2009 Share Posted September 13, 2009 Sorry but you have not explained what you want to achieve. Nobody is going to read through your code (php OR javascript) to decipher what you are trying to communicate. EXPLAIN in such a manner that no one will have to ask you a question in order to understand your problem. Quote Link to comment Share on other sites More sharing options...
Gayner Posted September 13, 2009 Author Share Posted September 13, 2009 Sorry but you have not explained what you want to achieve. Nobody is going to read through your code (php OR javascript) to decipher what you are trying to communicate. EXPLAIN in such a manner that no one will have to ask you a question in order to understand your problem. I made a new post, sorry for posting that javascript. Look above ur post.. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 13, 2009 Share Posted September 13, 2009 are you saying that when you go to /forums/rofl.php?&s=hey you want to parse that xml and replace the 2 with what ever $_GET['s'] is then print that out? Quote Link to comment Share on other sites More sharing options...
Gayner Posted September 13, 2009 Author Share Posted September 13, 2009 are you saying that when you go to /forums/rofl.php?&s=hey you want to parse that xml and replace the 2 with what ever $_GET['s'] is then print that out? OMG yes,lol so far i have this: <?php header('Content-Type: text/xml; charset=UTF-8'); // Load and Start IPB SDK require_once "ipbsdk/ipbsdk_class.inc.php"; $SDK =& new IPBSDK(); global $ibforums; echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <gt> <s><![CDATA[2]]></s> </gt>'; mysql_query("UPDATE ibf_members SET s = '". mysql_real_escape_string($_GET["s"]) ."' WHERE id='{$ibforums->member["id"]}'"); ?> im calling <s> from: my javascript here: var o = this; this.xmlObj.onreadystatechange = function() { if(o.xmlObj && o.xmlObj.readyState == 4 && o.xmlObj.s == 200) { if(!o.xmlObj.responseXML && o.errorCallback) o.errorCallback(); o.waitingResponse = 0; if(o.callback) o.callback(o); } } Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 13, 2009 Share Posted September 13, 2009 NOT the best solution in the world but quick and nasty... <?php header('Content-Type: text/xml; charset=UTF-8'); // Load and Start IPB SDK require_once "ipbsdk/ipbsdk_class.inc.php"; $SDK =& new IPBSDK(); global $ibforums; echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <gt> <s><![CDATA[' . $_GET['s'] . ']]></s> </gt>'; mysql_query("UPDATE ibf_members SET s = '". mysql_real_escape_string($_GET["s"]) ."' WHERE id='{$ibforums->member["id"]}'"); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.