MySQL interesse |
|
Ik heb een script gemaakt maar hij werkt niet. Hoe kan ik dit verhelpen ?
Help me aub !
<?
function MaakCode($lengte=10) {
## De tekens die voorkomen in de sleutel
$tekens = array('1','2','3','4','5','6','7','8','9','0','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');
$code = '';
for($i = 1; $i <= $lengte; $i++)
$code .= $tekens[rand(0,10)];
return strtoupper($code);
}
$code = MaakCode();
if(isset($_POST['Submit'])){
if(empty($_POST['code'])){
echo "Geen code opgegeven";
echo "<br><br><a href='javascript:history.back(1);'>Terug</a>";
}
elseif($_POST['code'] != $code){
echo "Code is niet goed !";
echo "<br><br><a href='javascript:history.back(1);'>Terug</a>";
}
else {
echo"Code is goed !";
}
}
else {
echo "<form method=post>
<table width=267 height=27>
<tr>
<td width=90 height=21></td>
<td width=165 height=21>$code</td>
</tr>
<tr>
<td width=90 height=21>Code:</td>
<td width=165 height=21><input name=code type=text></td>
</tr>
<tr>
<td width=90 height=21></td>
<td width=165 height=21> <input type=submit value='controleer' name=Submit ></td>
</tr>
</table>
</form>";
}
?>
<? function MaakCode($lengte=10) { ## De tekens die voorkomen in de sleutel $tekens = array('1','2','3','4','5','6','7','8','9','0','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'); $code = ''; for($i = 1; $i <= $lengte; $i++) $code .= $tekens[rand(0,10)]; } $code = MaakCode(); if(isset($_POST['Submit'])){ if(empty($_POST['code'])){ echo "Geen code opgegeven"; echo "<br><br><a href='javascript:history.back(1);'>Terug</a>"; } elseif($_POST['code'] != $code){ echo "Code is niet goed !"; echo "<br><br><a href='javascript:history.back(1);'>Terug</a>"; } else { } } else { <table width=267 height=27> <tr> <td width=90 height=21></td> <td width=165 height=21>$code</td> </tr> <tr> <td width=90 height=21>Code:</td> <td width=165 height=21><input name=code type=text></td> </tr> <tr> <td width=90 height=21></td> <td width=165 height=21> <input type=submit value='controleer' name=Submit ></td> </tr> </table> </form>"; } ?>
Bedankt
|