matheod

Récupérer pseudo

May 29th, 2011
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2. define("KEY","8f2[...]47d");
  3. define("NAME","foire-aux-questions");
  4. if(!empty($_GET['uid']) AND !empty($_GET['name']) AND !empty($_GET['pubkey']))
  5. {
  6.     $uid=intval($_GET['uid']);
  7.     $name=$_GET['name'];
  8.     $pubkey=$_GET['pubkey'];
  9.     $xmluser = simplexml_load_file('http://muxxu.com/app/xml?app='.NAME.'&xml=user&id='.$uid.'&key='.md5(KEY.$pubkey)); // on ouvre le xml
  10.     if(!$xmluser->xpath("/error")) // Pas d'erreur
  11.     {
  12.         echo "Votre pseudo est : ".$xmluser['name'];
  13.     }
  14.     else // Erreur (pubkey ne correspondant pas à l'uid)
  15.     {
  16.         echo 'Merci de passer par <a href="http://muxxu.com/a/'.NAME.'" target="_parent">là</a> pour accéder à l\'application.';
  17.     }
  18. }
  19. else
  20. {
  21.     echo 'Merci de passer par <a href="http://muxxu.com/a/'.NAME.'" target="_parent">là</a> pour accéder à l\'application.';
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment