Welkom, Gast. Je bent niet ingelogd.

php registreren

Stijn
<b>Neuker</b>
Geplaatst op: 21 Feb 2007, 11:38
PimpCoins: 0
💸+
Bewerken Quote

ik zit weer met een probleem.
bij het registreer script.
je kan gewoon een acount aan maken zonder iets in te vullen.
nu vraag ik of iemand van jullie die beveiliging er kan op zetten?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
if(!isset($_POST['submit']))
{
?>
<form method="POST" action="#">
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
    <tr>
      <td width="17%">Gebruikersnaam:</td>
      <td width="83%"><input type="text" name="gebr" size="20"></td>
    </tr>
    <tr>
      <td width="17%">Wachtwoord:</td>
      <td width="83%"><input type="text" name="ww" size="20"></td>
    </tr>
    <tr>
      <td width="17%">Wachtwoord bevestigen:</td>
      <td width="83%"><input type="text" name="ww2" size="20"></td>
    </tr>
    <tr>
      <td width="17%">E-mail adres:</td>
      <td width="83%"><input type="text" name="email" size="20"></td>
    </tr>
  </table>
  <input type="submit" value="Registreer" name="submit"></p>
</form>
<?php
}
else
{
$user = addslashes($_POST['gebr']);
$pass = addslashes($_POST['ww']);
$pass2 = addslashes($_POST['ww2']);
$email = addslashes($_POST['email']);
$check = mysql_num_rows(@mysql_query("SELECT * FROM leden WHERE username = '$user'"));
$a_code = rand();
if($check == 0 && $pass == $pass2)
{
mysql_query("INSERT INTO leden (username, password, actief, status, email, registratie_ip, activatiecode) VALUES ('$user', '$pass', '0', '1', '$email', '".$_SERVER['REMOTE_ADDR']."', '$a_code')");
echo"Succesvol geregistreerd!<br>Bekijk nu je inbox, je hebt een activatiemail ontvangen!";
$headers  = '(anti-spam-mime-version:) 1.0' . "\r\n";
$headers .= '(anti-spam-content-type:) text/html; charset=iso-8859-1' . "\r\n";
mail($email, "Activatiecode DownloadPlace", "Je bent geregistreerd op DownloadPlace!<br>Je moet je account alleen nog wél activeren.<br>Klik <a href=http://dp.radiozone.be/index.php?pagina=account/activeren&code=".$a_code.">hier</a> om je account te activeren!</a>", $headers);
}
else
{
echo"Er is iets fout gegaan tijdens het registreren!";
}
}
?>

Triple
Geplaatst op: 21 Feb 2007, 18:48
PimpCoins: 0
💸+
Bewerken Quote

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
if(!isset($_POST['submit']))
{
?>
<form method="POST" action="#">
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
    <tr>
      <td width="17%">Gebruikersnaam:</td>
      <td width="83%"><input type="text" name="gebr" size="20"></td>
    </tr>
    <tr>
      <td width="17%">Wachtwoord:</td>
      <td width="83%"><input type="text" name="ww" size="20"></td>
    </tr>
    <tr>
      <td width="17%">Wachtwoord bevestigen:</td>
      <td width="83%"><input type="text" name="ww2" size="20"></td>
    </tr>
    <tr>
      <td width="17%">E-mail adres:</td>
      <td width="83%"><input type="text" name="email" size="20"></td>
    </tr>
  </table>
  <input type="submit" value="Registreer" name="submit"></p>
</form>
<?php
}
else
{
$user = addslashes($_POST['gebr']);
$pass = addslashes($_POST['ww']);
$pass2 = addslashes($_POST['ww2']);
$email = addslashes($_POST['email']);
$check = mysql_num_rows(@mysql_query("SELECT * FROM leden WHERE username = '$user'"));
$a_code = rand();
if($check == 0 && $pass == $pass2 && !empty($user, $pass, $pass2, $email))
{
mysql_query("INSERT INTO leden (username, password, actief, status, email, registratie_ip, activatiecode) VALUES ('$user', '$pass', '0', '1', '$email', '".$_SERVER['REMOTE_ADDR']."', '$a_code')");
echo"Succesvol geregistreerd!<br>Bekijk nu je inbox, je hebt een activatiemail ontvangen!";
$headers  = '(anti-spam-(anti-spam-(anti-spam-mime-version:))) 1.0' . "rn";
$headers .= '(anti-spam-(anti-spam-(anti-spam-content-type:))) text/html; charset=iso-8859-1' . "rn";
mail($email, "Activatiecode DownloadPlace", "Je bent geregistreerd op DownloadPlace!<br>Je moet je account alleen nog wél activeren.<br>Klik <a href=http://dp.radiozone.be/index.php?pagina=account/activeren&code=".$a_code.">hier</a> om je account te activeren!</a>", $headers);
}
else
{
echo"Er is iets fout gegaan tijdens het registreren!";
}
}
?>

📫

Nieuw privébericht

🔥

Registreren


Login