Onbekend |
|
Ik heb hier een signup script, maar toen ik er een wachtwoord generator wou bijzetten liep het mis,
Parse error: parse error, unexpected T_ELSEIF in /home2/mats/public_html/counter-terrors/signup.php on line 137
Parse error: parse error, unexpected T_ELSEIF in /home2/mats/public_html/counter-terrors/signup.php on line 137
Dit was de fout
<?
ob_start();
?>
<?php /* ------------------------- */
include("_include-config.php");
if($data->level == 1) {
print " <tr><td class=\"mainTxt\">Je bent al lid.</td></tr>\n";
exit; }
if($data->level == 255) {
print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald admin zelf.</td></tr>\n";
exit; }
if($data->level == 100) {
print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald een hacker.</td></tr>\n";
exit; }
if($data->level == 2) {
print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald een hacker.</td></tr>\n";
exit; }
if($data->level == 100) {
print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald een hacker.</td></tr>\n";
exit; }
if($data->level == 10) {
print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald een hacker.</td></tr>\n";
exit; }
$login = $_POST['login'];
$pass = $_POST['pass'];
$passconfirm = $_POST['passconfirm'];
$email = $_POST['email'];
$type = $_POST['type'];
$IP = $_SERVER['REMOTE_ADDR'];
${"select$type"} = "selected";
if(isset($_POST['submit'])) {
$message = Array(
"Je login mag alleen A-Z, a-z, 0-9, _ en - hebben",
"De wachtwoorden die je gaf zijn niet identiek",
"Vul een geldig e-mail adres in",
"Selecteer een type crimineel",
"Er bestaat al iemand met die login",
"Er is al iemand met die e-mail");
$msgnum = -1;
if(preg_match('/^[a-zA-Z0-9_\-]+$/',$login) == 0)
$msgnum = 0;
if($pass == "" || $pass != $passconfirm)
$msgnum = 1;
if(preg_match('/^.+@.+\..+$/',$email) == 0)
$msgnum = 2;
if($type != 1 && $type != 2 && $type != 3)
$msgnum = 3;
else {
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `login`='$login'");
if(mysql_num_rows($dbres) > 0)
$msgnum = 4;
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `email`='$email'");
if(mysql_num_rows($dbres) > 0)
$msgnum = 5;
if($msgnum == -1) {
$code = rand(100000,999999);
mysql_query("UPDATE `[users]` SET `bank`=`bank`+'25000' WHERE `login`='{$recruiter}'");
mysql_query("INSERT INTO `[users]`(signup,login,pass,IP,email,type) values(NOW(),'$login',MD5('$pass'),'$IP','$email',$type)");
mysql_query("INSERT INTO nieuwsbrief (naam, email) VALUES (\"$login\", \"$email\")");
mysql_query("INSERT INTO `[temp]`(login,IP,code,area,time) values('$login','$IP',$code,'signup',NOW())");
$id = mysql_insert_id();
$dbres = mysql_query("SELECT `login` FROM `[temp]` WHERE `area`='signup' AND `id`='$id' AND `code`='$code'");
}
}
}
/* ------------------------- */ ?>
<html>
<head>
<title><--counter terrors--></title>
<link rel="stylesheet" type="text/css" href="css-v1.css">
</head>
<body style="background: #996600; margin: 0px;">
<table align="center" width=100%>
<?php /* ------------------------- */
if(isset($_GET['id'],$_GET['code'])) {
print " <tr><td class=\"subTitle\"><b>Activatie</b></td></tr>\n";
if($data = mysql_fetch_object($dbres)) {
mysql_query("UPDATE `[users]` SET `activated`=1,`signup`=NOW() WHERE `login`='{$data->login}'");
mysql_query("DELETE FROM `[temp]` WHERE `id`='$id'");
print " <tr><td class=\"mainTxt\"></td></tr>\n";
}
}
else {
if($msgnum != -1) {
print " <tr><td class=\"subTitle\"><b>Aanmelden</b></td></tr>\n";
if(isset($msgnum) && $msgnum != -1)
print " <tr><td class=\"mainTxt\">\n {$message[$msgnum]}\n </td></tr>\n";
$rec = $_GET['rec'];
?>
<tr><td class="mainTxt">
<center><img src="images/bliksem.gif"></center>
<b> Alstublieft een aanmelding per persoon. </b>
<form method="post"><table align="center">
<tr><td width=100>Login:</td> <td><input type="text" name="login" maxlength=16 style="width: 150;" value="<? echo $login ?>"><b>Min. 3 tekens</b></td></tr>
<tr><td width=100>Wachtwoord:</td> <td><input type="password" name="pass" maxlength=16 style="width: 150;">Weet u geen wachtwoord? <a href="javascript: //" onClick="window.open('signup.php?x=wwgen')">kijk hier</a></td></tr>
<tr><td width=100>Herhaal:</td> <td><input type="password" name="passconfirm" maxlength=16 style="width: 150;"></td></tr>
<tr><td width=100>E-Mail:</td> <td><input type="text" name="email" maxlength=64 style="width: 150;" value="<? echo $emaill ?>"></td></tr>
<tr><td width=100>Type:</td> <td><select name="type" style="width: 150;">
<option value="1" $select1>counter terrorist</option>
<option value="2" $select2>terrorist</option>
<option value="3" $select3>wetenschapper</option>
</select> <a href="javascript: //" onClick="window.open('help.php#types')">[?]</a></td></tr>
</td></tr>
<tr><td></td><td align="right"><input type="submit" name="submit" style="width: 100;" value="Aanmelden"></td></tr>
</table></form><br>
</td></tr>
<?
}
else
print " <tr><td class=\"mainTxt\">Je bent geregistreerd. Je kunt nu inloggen.</td></tr>\n";
elseif(isset($_GET['x'] == "wwgen")){
<?php
$version = "20041107-a";
if (!isset($wwlen)) {
// first-time through
$wwlen = 8;
$checked1 = "checked";
$checked2 = "";
$checked3 = "";
$melding = "";
} else {
$checked1 = "";
$checked2 = "";
$checked3 = "";
if ($sterkte == "s1") {
$pattern = "[a-zA-Z0-9]";
$checked1 = "checked";
} elseif($sterkte == "s2") {
$pattern = "[a-zA-Z]";
$checked2 = "checked";
} else {
$pattern = "[abcdefghijklmnopqrstuvwxyz]";
$checked3 = "checked";
}
// validate
if ($wwlen < 1 or $wwlen > 16) {
$melding = "Wachtwoordlengte ligt buiten de toegestane waarde (1-16)";
} else {
// generate
$genpass = NULL;
for ($i=0; $i<$wwlen; $i++) {
$char = chr(rand(48,122));
while (!ereg($pattern, $char)) {
$char = chr(rand(48,122));
}
$genpass .= $char;
}
$melding = "WachtWoord: <input type='text' size='25' value='$genpass'>";
}
}
// # debug
// echo "<br>wwlen : $wwlen<br>
// sterkte: $sterkte<br>
// pattern: $pattern<br>
// checked1 $checked1<br>
// checked2 $checked2<br>
// checked3 $checked3<br>";
?>
<html>
<head>
<?php echo "<!versie=$version>" ?>
<script language=JavaScript>
<!--
function initialFocus(){document.myForm.wwlen.focus();}
// -->
</script>
<link rel='stylesheet' type='text/css' href='jtzondag.css'>
</head>
<body bgcolor='#996600' text='ffffff' onload='initialFocus()'>
<div align='center'>
<table border='0' width='760' cellspacing='0' cellpadding='0'><tr><td>
<h1>WachtWoord Generator</h1>
<p>Vul de gewenste lengte in, kies een sterkte en klik op Genereer.</p>
<?php
echo "<form name='myForm' method='POST' action='$PHP_SELF'>
<table border='0'>
<tr>
<td >WachtWoord lengte</td>
<td ><input type='text' name='wwlen' size='2' value='$wwlen' maxlength='2'></td>
</tr>
<tr>
<td ></td>
<td ></td>
</tr>
<tr>
<td >Sterk (a - z, A - Z en 0 - 9)</td>
<td ><input type='radio' name='sterkte' value='s1' $checked1></td>
</tr>
<tr>
<td >Middel (a - z en A - Z)</td>
<td ><input type='radio' name='sterkte' value='s2' $checked2></td>
</tr>
<tr>
<td >Zwak (a - z)</td>
<td ><input type='radio' name='sterkte' value='s3' $checked3></td>
</tr>
<tr>
<td ></td>
<td ></td>
</tr>
<tr>
<td ><input type='submit' value='Genereer' name='Button1'></td>
</tr>
</table>
</form>";
echo $melding;
echo "<br><br><br><font size=-3>Versie $version</font>";
</td></tr></table></div>
}
mysql_close();
?>
</table>
<center><a href="index.php">KLIK HIER</a> <font color="white">om terug tegaan naar het hoofdmenu</font></center>
</body>
</html>
<? ?> <?php /* ------------------------- */ include("_include-config.php"); if($data->level == 1) { print " <tr><td class=\"mainTxt\">Je bent al lid.</td></tr>\n"; if($data->level == 255) { print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald admin zelf.</td></tr>\n"; if($data->level == 100) { print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald een hacker.</td></tr>\n"; if($data->level == 2) { print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald een hacker.</td></tr>\n"; if($data->level == 100) { print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald een hacker.</td></tr>\n"; if($data->level == 10) { print " <tr><td class=\"mainTxt\">Je bent al lid, meer bepaald een hacker.</td></tr>\n"; $login = $_POST['login']; $pass = $_POST['pass']; $passconfirm = $_POST['passconfirm']; $email = $_POST['email']; $type = $_POST['type']; $IP = $_SERVER['REMOTE_ADDR']; ${"select$type"} = "selected"; if(isset($_POST['submit'])) { "Je login mag alleen A-Z, a-z, 0-9, _ en - hebben", "De wachtwoorden die je gaf zijn niet identiek", "Vul een geldig e-mail adres in", "Selecteer een type crimineel", "Er bestaat al iemand met die login", "Er is al iemand met die e-mail"); $msgnum = -1; $msgnum = 0; if($pass == "" || $pass != $passconfirm) $msgnum = 1; $msgnum = 2; if($type != 1 && $type != 2 && $type != 3) $msgnum = 3; else { $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `login`='$login'"); $msgnum = 4; $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `email`='$email'"); $msgnum = 5; if($msgnum == -1) { $code = rand(100000,999999); mysql_query("UPDATE `[users]` SET `bank`=`bank`+'25000' WHERE `login`='{$recruiter}'"); mysql_query("INSERT INTO `[users]`(signup,login,pass,IP,email,type) values(NOW(),'$login',MD5('$pass'),'$IP','$email',$type)"); mysql_query("INSERT INTO nieuwsbrief (naam, email) VALUES (\"$login\", \"$email\")"); mysql_query("INSERT INTO `[temp]`(login,IP,code,area,time) values('$login','$IP',$code,'signup',NOW())"); $dbres = mysql_query("SELECT `login` FROM `[temp]` WHERE `area`='signup' AND `id`='$id' AND `code`='$code'"); } } } /* ------------------------- */ ?> <html> <head> <title><--counter terrors--></title> <link rel="stylesheet" type="text/css" href="css-v1.css"> </head> <body style="background: #996600; margin: 0px;"> <table align="center" width=100%> <?php /* ------------------------- */ if(isset($_GET['id'],$_GET['code'])) { print " <tr><td class=\"subTitle\"><b>Activatie</b></td></tr>\n"; mysql_query("UPDATE `[users]` SET `activated`=1,`signup`=NOW() WHERE `login`='{$data->login}'"); print " <tr><td class=\"mainTxt\"></td></tr>\n"; } } else { if($msgnum != -1) { print " <tr><td class=\"subTitle\"><b>Aanmelden</b></td></tr>\n"; if(isset($msgnum) && $msgnum != -1) print " <tr><td class=\"mainTxt\">\n {$message[$msgnum]}\n </td></tr>\n"; $rec = $_GET['rec']; ?> <tr><td class="mainTxt"> <center><img src="images/bliksem.gif"></center> <b> Alstublieft een aanmelding per persoon. </b> <form method="post"><table align="center"> <tr><td width=100>Login:</td> <td><input type="text" name="login" maxlength=16 style="width: 150;" value=" <? echo $login ?>"><b>Min. 3 tekens</b></td></tr> <tr><td width=100>Wachtwoord:</td> <td><input type="password" name="pass" maxlength=16 style="width: 150;">Weet u geen wachtwoord? <a href="javascript: //" onClick="window.open('signup.php?x=wwgen')">kijk hier</a></td></tr> <tr><td width=100>Herhaal:</td> <td><input type="password" name="passconfirm" maxlength=16 style="width: 150;"></td></tr> <tr><td width=100>E-Mail:</td> <td><input type="text" name="email" maxlength=64 style="width: 150;" value=" <? echo $emaill ?>"></td></tr> <tr><td width=100>Type:</td> <td><select name="type" style="width: 150;"> <option value="1" $select1>counter terrorist</option> <option value="2" $select2>terrorist</option> <option value="3" $select3>wetenschapper</option> </select> <a href="javascript: //" onClick="window.open('help.php#types')">[?]</a></td></tr> </td></tr> <tr><td></td><td align="right"><input type="submit" name="submit" style="width: 100;" value="Aanmelden"></td></tr> </table></form><br> </td></tr> <? } else print " <tr><td class=\"mainTxt\">Je bent geregistreerd. Je kunt nu inloggen.</td></tr>\n"; elseif(isset($_GET['x'] == "wwgen")){ <?php $version = "20041107-a"; // first-time through $wwlen = 8; $checked1 = "checked"; $checked2 = ""; $checked3 = ""; $melding = ""; } else { $checked1 = ""; $checked2 = ""; $checked3 = ""; if ($sterkte == "s1") { $pattern = "[a-zA-Z0-9]"; $checked1 = "checked"; } elseif($sterkte == "s2") { $pattern = "[a-zA-Z]"; $checked2 = "checked"; } else { $pattern = "[abcdefghijklmnopqrstuvwxyz]"; $checked3 = "checked"; } // validate if ($wwlen < 1 or $wwlen > 16) { $melding = "Wachtwoordlengte ligt buiten de toegestane waarde (1-16)"; } else { // generate $genpass = NULL; for ($i=0; $i<$wwlen; $i++) { while (!ereg($pattern, $char)) { } $genpass .= $char; } $melding = "WachtWoord: <input type='text' size='25' value='$genpass'>"; } } // # debug // echo "<br>wwlen : $wwlen<br> // sterkte: $sterkte<br> // pattern: $pattern<br> // checked1 $checked1<br> // checked2 $checked2<br> // checked3 $checked3<br>"; ?> <html> <head> <?php echo "<!versie=$version>" ?> <script language=JavaScript> <!-- function initialFocus(){document.myForm.wwlen.focus();} // --> </script> <link rel='stylesheet' type='text/css' href='jtzondag.css'> </head> <body bgcolor='#996600' text='ffffff' onload='initialFocus()'> <div align='center'> <table border='0' width='760' cellspacing='0' cellpadding='0'><tr><td> <h1>WachtWoord Generator</h1> <p>Vul de gewenste lengte in, kies een sterkte en klik op Genereer.</p> <?php echo "<form name='myForm' method='POST' action='$PHP_SELF'> <table border='0'> <tr> <td >WachtWoord lengte</td> <td ><input type='text' name='wwlen' size='2' value='$wwlen' maxlength='2'></td> </tr> <tr> <td ></td> <td ></td> </tr> <tr> <td >Sterk (a - z, A - Z en 0 - 9)</td> <td ><input type='radio' name='sterkte' value='s1' $checked1></td> </tr> <tr> <td >Middel (a - z en A - Z)</td> <td ><input type='radio' name='sterkte' value='s2' $checked2></td> </tr> <tr> <td >Zwak (a - z)</td> <td ><input type='radio' name='sterkte' value='s3' $checked3></td> </tr> <tr> <td ></td> <td ></td> </tr> <tr> <td ><input type='submit' value='Genereer' name='Button1'></td> </tr> </table> </form>"; echo "<br><br><br><font size=-3>Versie $version</font>"; </td></tr></table></div> } ?> </table> <center><a href="index.php">KLIK HIER</a> <font color="white">om terug tegaan naar het hoofdmenu</font></center> </body> </html>
|