reddit tagger for hero0fwar


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

The only bit i changed was the if statement at the bottom...


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 [r/MW2 & r/CODBO] - Created by philkav for r/mw2 & r/codbo. 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/alien2.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 == "2a15349")
  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/codbo">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.  
  84.  
  85. if($allstar == true && $allstarpassword == "2a15349")
  86. {
  87. $myFile = "names.txt";
  88. $fileHandler = fopen($myFile,'a') or die("can't open file...");
  89. $allData =
  90. ".author[href$=\"/".$username."\"]:after {
  91. content: \"(".$gamertag.")[".$system."]\";
  92. }
  93. .author[href$=\"/".$username."\"]:before {
  94. color: #FF0000;
  95. content: \"[r/A*]\";
  96. }
  97. ";
  98. fwrite($fileHandler, $allData);
  99. fclose($fileHandler);
  100.  
  101.  
  102. }
  103.  
  104.  
  105. else
  106. {
  107. $myFilePC = "namesPC.txt";
  108. $fileHandlerPC = fopen($myFilePC,'a') or die("can't open file...");
  109.  
  110. $myFilePS3 = "namesPS3.txt";
  111. $fileHandlerPS3 = fopen($myFilePS3,'a') or die("can't open file...");
  112.  
  113. $myFile360 = "names360.txt";
  114. $fileHandler360 = fopen($myFile360,'a') or die("can't open file...");
  115.  
  116. if ($system == "PC")
  117. {
  118. $allData = ".author[href$=\"/".$username."\"]:after{
  119. content: \"(".$gamertag.")[".$system."]\" !important;
  120. }
  121. ";
  122. fwrite($fileHandlerPC, $allData);
  123. fclose($fileHandlerPC);
  124. }
  125.  
  126. else if ($system == "PS3")
  127. {
  128. $allData = ".author[href$=\"/".$username."\"]:after{
  129. content: \"(".$gamertag.")[".$system."]\" !important;
  130. }
  131. ";
  132. fwrite($fileHandlerPS3, $allData);
  133. fclose($fileHandlerPS3);
  134. }
  135.  
  136. else
  137. {
  138. $allData = ".author[href$=\"/".$username."\"]:after{
  139. content: \"(".$gamertag.")[".$system."]\" !important;
  140. }
  141. ";
  142. fwrite($fileHandler360, $allData);
  143. fclose($fileHandler360);
  144. }
  145.  
  146. }
  147.  
  148.  
  149.  
  150. ?>
  151. </body>
  152. </html>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.