Forum Moderators: coopster
Parse error: syntax error, unexpected T_STRING in C:\xampp\xampplite\htdocs\decrypt.php on line 3
<?php
if($_GET['main'] == "decypter") {
$characters = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U', 'V','W','X','Y','Z','!','?','1','2','3','4','5','6','7','8','9','0',';',':','!','"','£', '$','%','^,'&','*','+','?','.','|','¬');
$i++;
foreach($characters=>$i) {
if($_POST['md5']) {
if(md5($characters) == $_POST['encypted']) {
echo 'Decrypted! Your decrypted string is: \''.$characters.'\'. :) Have fun!';
exit;
} else if(md5($characters) != $_POST['encypted']) {
echo 'Failed attempt';
return;
}
}
} else if($_POST['sha1']) {
if(sha1($characters) == $_POST['encypted']) {
echo 'Decrypted! Your decrypted string is: \''.$characters.'\'. :) Have fun!';
exit;
} else if(md5($characters) != $_POST['encypted']) {
echo 'Failed attempt';
return;
}
}
}
}
?>
<html>
<head>
<title> decypter! </title>
</head>
<body>
<form action="?main=decrypter" method="POST">
<textbox name="encypted"></textbox>
<input type="radio" name="radio1" value="SHA1" checked> SHA1<br/>
<input type="radio" name="radio1" value="MD5"> MD5<br/>
<input type="submit" value="Login"></div>
</form>
</body>
</head>
[edited by: eelixduppy at 10:00 am (utc) on Jun 23, 2010]
[edit reason] fixed side scroll [/edit]
<?php
if($_GET['main'] == "decrypter") {
$characters = array(range('A','Z'),'!','?',range('0','9'),';',':','!','"','£','$','%','^','&','*','+','?','.','|','¬');
$i++;
foreach($characters=>$i) {
if($_POST['md5']) {
if(md5($characters) == $_POST['encypted']) {
echo 'Decrypted! Your decrypted string is: \''.$characters.'\'. :) Have fun!';
exit;
} else if(md5($characters) != $_POST['encypted']) {
echo 'Failed attempt';
return;
}
}
} else if($_POST['sha1']) {
if(sha1($characters) == $_POST['encypted']) {
echo 'Decrypted! Your decrypted string is: \''.$characters.'\'. :) Have fun!';
exit;
} else if(md5($characters) != $_POST['encypted']) {
echo 'Failed attempt';
return;
}
}
}
}
?>
<html>
<head>
<title> decypter! </title>
</head>
<body>
<form action="?main=decrypter" method="POST">
<textbox name="encypted"></textbox>
<input type="radio" name="radio1" value="sha1" checked> SHA1<br/>
<input type="radio" name="radio1" value="md5"> MD5<br/>
<input type="submit" value="Login"></div>
</form>
</body>
</head>
Parse error: syntax error, unexpected T_DOUBLE_ARROW in C:\xampp\xampplite\htdocs\decrypt.php on line 8