Return to Snippet

Revision: 35547
at November 10, 2010 06:28 by philkav


Initial Code
<html>
<head>
	<title> Reddit Tagger </title>
</head>
<body>

<?php

$username = $_POST["username"];
$system = $_POST["system"];
$gamertag = $_POST["gamertag"];
$allstar = $_POST["allstar"];
$allstarpassword = $_POST["allstarpassword"];
?>

<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>
<hr/>

<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<form action = "add.php" method = "post">
<div align = "center">
	<table>
		<tr>
			<td>
				<img src = "img/alien2.png">
			</td>
			<td>
			<table>
				<tr>
					<td>Reddit Name : &nbsp;</td>
					<td align = "left"><?php echo $username;?></td>
				</tr>
				<tr>
					<td>MW2 System : </td>
					<td align = "left"><?php echo $system;?></td>
				</tr>
				<tr>
					<td>GamerTag: </td>
					<td align = "left"><?php echo $gamertag;?></td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
	
	<br/>
	<font color = "Blue">
	Your tag : 
	</font>
	<font color = "Red">
	<?php 
	if($allstar == true && $allstarpassword == "2a15349")
	{
		echo "[r/A*]".$username."(".$gamertag.")[".$system."]";
	}
	else
	{
		echo $username."(".$gamertag.")[".$system."]";
	}
	
	?>
	</font>
	<font color = "Blue">
	<br/>This will be appended to your name within the <u>next few hours.</u>
	<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>.
	</font>
	
	<br/><br/><font color = "Black">
	Now take me <a href = "http://www.reddit.com/r/codbo">back to reddit!</a>
	</font>
	
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</div>

</form>


<?php

//adding logic goes here : 




if($allstar == true && $allstarpassword == "2a15349")
{
$myFile = "names.txt";
$fileHandler = fopen($myFile,'a') or die("can't open file...");
$allData = 	
".author[href$=\"/".$username."\"]:after {
    content: \"(".$gamertag.")[".$system."]\";
    }
.author[href$=\"/".$username."\"]:before {
    color: #FF0000;
    content: \"[r/A*]\";
    }
";
fwrite($fileHandler, $allData);
fclose($fileHandler);


}


else
{
$myFilePC = "namesPC.txt";
$fileHandlerPC = fopen($myFilePC,'a') or die("can't open file...");

$myFilePS3 = "namesPS3.txt";
$fileHandlerPS3 = fopen($myFilePS3,'a') or die("can't open file...");

$myFile360 = "names360.txt";
$fileHandler360 = fopen($myFile360,'a') or die("can't open file...");

if ($system == "PC")
{
	$allData = ".author[href$=\"/".$username."\"]:after{
  	  content: \"(".$gamertag.")[".$system."]\" !important;
  	  }
";
	fwrite($fileHandlerPC, $allData);
	fclose($fileHandlerPC);
}

else if ($system == "PS3")
{
	$allData = ".author[href$=\"/".$username."\"]:after{
  	  content: \"(".$gamertag.")[".$system."]\" !important;
  	  }
";
	fwrite($fileHandlerPS3, $allData);
	fclose($fileHandlerPS3);
}

else
{
	$allData = ".author[href$=\"/".$username."\"]:after{
  	  content: \"(".$gamertag.")[".$system."]\" !important;
  	  }
";
	fwrite($fileHandler360, $allData);
	fclose($fileHandler360);
}

}



?>
</body>
</html>

Initial URL

                                

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

Initial Title
reddit tagger for hero0fwar

Initial Tags

                                

Initial Language
PHP