Reddit Username Tagger [add.php]


/ Published in: PHP
Save to your folder(s)

By Philkav for reddit [r/mw2]


Copy this code and paste it in your HTML
  1. <html>
  2. <head>
  3. <title> Reddit Tagger </title>
  4. </head>
  5. <body>
  6.  
  7. <?php
  8.  
  9. $username = $_POST["username"];
  10. $system = $_POST["system"];
  11. $gamertag = $_POST["gamertag"];
  12. $allstar = $_POST["allstar"];
  13. $allstarpassword = $_POST["allstarpassword"];
  14. ?>
  15.  
  16. <h6>REDDIT Tagger [MW2] - Created by philkav for r/mw2. Feel free to use this on other subreddits (PM me for PHP code)</h6>
  17. <hr/>
  18.  
  19. <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  20. <form action = "add.php" method = "post">
  21. <div align = "center">
  22. <table>
  23. <tr>
  24. <td>
  25. <img src = "img/redditAlien.png">
  26. </td>
  27. <td>
  28. <table>
  29. <tr>
  30. <td>Reddit Name : &nbsp;</td>
  31. <td align = "left"><?php echo $username;?></td>
  32. </tr>
  33. <tr>
  34. <td>MW2 System : </td>
  35. <td align = "left"><?php echo $system;?></td>
  36. </tr>
  37. <tr>
  38. <td>GamerTag: </td>
  39. <td align = "left"><?php echo $gamertag;?></td>
  40. </tr>
  41. </table>
  42. </td>
  43. </tr>
  44. </table>
  45.  
  46. <br/>
  47. <font color = "Blue">
  48. Your tag :
  49. </font>
  50. <font color = "Red">
  51. <?php
  52. if($allstar == true && $allstarpassword == "*******")
  53. {
  54. echo "[r/A*]".$username."(".$gamertag.")[".$system."]";
  55. }
  56. else
  57. {
  58. echo $username."(".$gamertag.")[".$system."]";
  59. }
  60.  
  61. ?>
  62. </font>
  63. <font color = "Blue">
  64. <br/>This will be appended to your name within the <u>next few hours.</u>
  65. <br/>Make sure your names are in the correct case and if you made a mistake, just go back and <a href = "index.php">resubmit</a>.
  66. </font>
  67.  
  68. <br/><br/><font color = "Black">
  69. Now take me <a href = "http://www.reddit.com/r/mw2">back to reddit!</a>
  70. </font>
  71.  
  72. <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  73. </div>
  74.  
  75. </form>
  76.  
  77.  
  78. <?php
  79.  
  80. //adding logic goes here :
  81.  
  82.  
  83. if($allstar == true && $allstarpassword == "*******")
  84. {
  85. $myFile = "names.txt";
  86. $fileHandler = fopen($myFile,'a') or die("can't open file...");
  87. $allData =
  88. ".author[href$=\"/".$username."\"]:after {
  89. content: \"(".$gamertag.")[".$system."]\";
  90. }
  91. .author[href$=\"/".$username."\"]:before {
  92. color: #FF0000;
  93. content: \"[r/A*]\";
  94. }
  95. ";
  96. fwrite($fileHandler, $allData);
  97. fclose($fileHandler);
  98.  
  99.  
  100. }
  101.  
  102.  
  103. else
  104. {
  105. $myFile = "names.txt";
  106. $fileHandler = fopen($myFile,'a') or die("can't open file...");
  107. $allData = ".author[href$=\"/".$username."\"]:after{
  108. content: \"(".$gamertag.")[".$system."]\" !important;
  109. }
  110. ";
  111. fwrite($fileHandler, $allData);
  112. fclose($fileHandler);
  113.  
  114. }
  115.  
  116.  
  117.  
  118. ?>
  119. </body>
  120. </html>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.