gnopaste

Sorry for this ugly message. We are searching for some translators.
Please take a look here
Thanks to all translators, you're doing a great job!

Name
aton
Scriptlanguage
Plain Text
Tabwidth
4
Date
07/28/2010 06:33:51 pm
IP
84.56.70.228

mediawiki api call to login user from an external script using a javascript xmlhttprequest

  1.         echo '
  2.         <html><head></head><body>
  3.                 <script>
  4.                     <!--
  5.                     var params="action=login&lgname='.htmlspecialchars($username).'&lgpassword='.$password.'";
  6.                     var url="'.$wikirurl.'api.php";
  7.                     var req = new XMLHttpRequest();
  8.                         
  9.                     req.open("POST", url, false);
  10.                     req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  11.                     req.setRequestHeader("Content-length", params.length);
  12.                     req.setRequestHeader("Connection", "close");
  13.  
  14.                     req.send(params);
  15.  
  16.                     window.location.href = "'.htmlspecialchars($returnto).'";
  17.                     -->
  18.                 </script>
  19.                 <noscript>
  20.                 Your Browser doesnt support JavaScript. No problem. <a href="'.$returnto.'">&rarr; Continue here &larr;</a>
  21.                 </noscript>
  22.             </body>
  23.         </html>
  24.         ';
  25.  
submitter » gnopaster | imprint « imprint     
» Terms of use «


Donate via Bitcoin:
1KCq5UvwuTMwgSAHUsd7eqkBWTHZau1ydN