-Vorraussetzungen um das script zu usen ( AHNUNG VON P
PHP Code:
<?php
$host = "";
$user = "";
$pw = "";
$db = "";
$kommentar = "*Bitte alle Felder korrekt ausfüllen !";
$connect = mysql_connect($host,$user,$pw)
or die (mysql_error());
mysql_select_db($db,$connect)
or die (mysql_error());
?>
<center>
<h3>###Überschrift###</h3><p />
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
Username:<br /><input name="username" type="text" size="30" maxlength="15" /><br />
Password:<br /><input name="password" type="password" size="30" maxlength="15" /><br />
Password Wiederholen:<br /><input name="password-re" type="password" size="30" maxlength="15" /><br />
E-Mail:<br /><input name="email" type="text" size="30" /><p />
<div id="submit"><input type="submit" name="gesendet" value=""/></div>
</form>
<?php
if(!empty($_POST))
{
unset($kommentar);
if(empty($_POST['username']))
{
$kommentar .= "*Bitte gebe einen Username ein.";
}
if($_POST['password'] != $_POST['password-re'] || empty($_POST['password']))
{
$kommentar .= "<br />*Bitte gebe 2 Mal das selbe Password ein.";
}
if(!strstr($_POST['email'],"@"))
{
$kommentar .= "<br />*Bitte gebe eine gültige E-Mail Adresse ein.";
}
else
{
$username = $_POST['username'];
$pw = md5($_POST['password']);
$mail = $_POST['email'];
mysql_query("INSERT INTO account(username,password,perms,email) // hier eure tabellen namen anpassen VALUES('$username','$pw','1','$mail')", $connect);
$kommentar = "*Du hast alle Felder richtig ausgefüllt. Dein Account wurde erstellt !";
?>
<head>
<meta http-equiv="refresh" content="3; URL=http://euereseite/login.php "> // das login.php hab ich in der section e*pvp coder released
</head>
<?php
}
}
echo "<p />".$kommentar."<br />";
?>
<div id="click" style="cursor:pointer; color:BlanchedAlmond; border-top:1px solid grey; padding-top:10px;">
|| Deine IP ( Internet Protocoll ) ||
</div>
<div id="event"><?php echo "<p /><p style='border: 3px solid grey; width:245px; color:SeaGreen; margin-top:0; height:30px; padding-top:10px;'><b>Deine IP Lautet =></b> ".$_SERVER['REMOTE_ADDR']."<br /></p>";?> </div>
<script>
$('#event').hide();
$('#click').click(function () {
if ($("#event").is(":hidden")) {
$("#event").slideDown("slow");
} else {
$("#event").hide();
}
});
</script>
</center>