Im currently having a problem with one of my scripts. This is the first time that I tried a little more advanced programming in PHP and im developing some code to decode an already coded file. The file was encoded with another custom script and works flawlessly. But unfortunatly, Im having a problem with this T_Variable error and I cant find where it is located. I checked the line in my code to which it is referring to and all syntax is placed correctly.
The code itself is below. Can you please lead me onto the correct path to help me fix it?
The error is on line 25. or so it says...
Code: Select all
<h3>License Decryptor</h3>
<p>Please enter the username of the licensee below:</p>
<?php
$path = dirname( __FILE__ );
$slash = '/'; strpos( $path, $slash ) ? '' : $slash = '/';
define( 'BASE_DIR', $path . $slash );
switch ($startDecrypt) {
case 0:
break;
case 1:
$username = $_GET['username'];
$filename = "license_generator/users/";
$filename .= $username;
$filename .= "/license.xml";
$dirPath = BASE_DIR . $filename; // folder path
if (!file_exists($dirPath)) {
echo "The User does not exist. Please check your input.";
}
else{
$file = fopen($dirPath, "r+");
$license = $file;
//Start Decryption Algorithm
$license = str_replace("004232","*" $license);
$license = str_replace("757394","&" $license);
$license = str_replace("10584793","^" $license);
$license = str_replace("000011","%" $license);
$license = str_replace("@3nfnsd0dhj230fpf96n36fg7684htr","$" $license);
$license = str_replace("533vnasd*s04n20vT583fnsd","#" $license);
$license = str_replace("1.v","@" $license);
$license = str_replace("ntN","!" $license);
$license = str_replace("000","9" $license);
$license = str_replace("7","8" $license);
$license = str_replace("005","7" $license);
$license = str_replace("720","6" $license);
$license = str_replace("Y91","5" $license);
$license = str_replace("bi3","4" $license);
$license = str_replace("001e","3" $license);
$license = str_replace("9.1","2" $license);
$license = str_replace("8::","1" $license);
$license = str_replace("101","0" $license);
$license = str_replace("88e","Z" $license);
$license = str_replace("0n1","z" $license);
$license = str_replace("aEa","Y" $license);
$license = str_replace("s^00","y" $license);
$license = str_replace("mth","X" $license);
$license = str_replace("!.u","x" $license);
$license = str_replace("559","W" $license);
$license = str_replace("61s","w" $license);
$license = str_replace("que","V" $license);
$license = str_replace("D02","v" $license);
$license = str_replace("#11","U" $license);
$license = str_replace("L(2","u" $license);
$license = str_replace("@0c","T" $license);
$license = str_replace("0&g","t" $license);
$license = str_replace("m24","S" $license);
$license = str_replace("40e","s" $license);
$license = str_replace("lQ1","R" $license);
$license = str_replace("249","r" $license);
$license = str_replace("x00","Q" $license);
$license = str_replace("1010","q" $license);
$license = str_replace("823","P" $license);
$license = str_replace("h4F","p" $license);
$license = str_replace("o60","O" $license);
$license = str_replace("db9","o" $license);
$license = str_replace("gw1","N" $license);
$license = str_replace("84t","n" $license);
$license = str_replace("00b","M" $license);
$license = str_replace("n16","m" $license);
$license = str_replace("tNo","L" $license);
$license = str_replace("116","l" $license);
$license = str_replace("200","K" $license);
$license = str_replace("n1x","k" $license);
$license = str_replace("624x","J" $license);
$license = str_replace("9Vw","j" $license);
$license = str_replace("p10","I" $license);
$license = str_replace("32v","i" $license);
$license = str_replace("04n","H" $license);
$license = str_replace("d!a","h" $license);
$license = str_replace("dxE","G" $license);
$license = str_replace("1:0","g" $license);
$license = str_replace("A00","f" $license);
$license = str_replace("wP9","E" $license);
$license = str_replace("618","e" $license);
$license = str_replace("1v6","D" $license);
$license = str_replace("000","d" $license);
$license = str_replace("@9p","C" $license);
$license = str_replace("l%1","c" $license);
$license = str_replace("f72","B" $license);
$license = str_replace("0e","b" $license);
$license = str_replace("01b","A" $license);
$license = str_replace("4e2","a" $license);
fclose($file);
$filename2 = "license_generator/users/";
$filename2 .= $username;
$filename2 .= "/license_decrypt.txt";
$dirPath2 = BASE_DIR . $filename2; // folder path
$file2 = fopen($dirPath2, 'w') or die("Can't open file");
fwrite($dirPath2, $license);
fclose($file2);
echo $license;
echo "<h3>View Decrypted License:</h3> <a href='".$dirPath2."' title='Download Decrypted License'>View License</a>";
break;
}
}
?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" name="decrypt_license" onSubmit= "<?php $startDecrypt =1;?>">
<input type="textbox" name="username" id="username" />
</form>
</div>Any help at all would be greatly appretiated.
Thank You.