Monday, May 21st 2012, 8:32pm UTC+2
You are not logged in.
Advanced Search
chrisid0707
Beginner
Posts: 11
1
Saturday, February 16th 2008, 1:43pm
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
<?php mysql_connect("", "web8","") or die ("Keine Verbindung moeglich"); mysql_select_db("usr_web8_7") or die ("Die Datenbank existiert nicht"); ?> <form method="post"> <table> <tr> <td>Username:</td><td><input type="text" name="username"></td> </tr> <tr> <td>Password:</td><td><input type="text" name="password"></td></tr> <tr> <td>Mail:</td><td><input type="text" name="mail"></td> </tr> </table> <input type="submit" name="submit" value="Registrieren"> </form> <?php if (isset($_POST['submit'])) { if (!$_POST['username'] | !$_POST['password'] ) { die('You did not complete all of the required fields'); } if (!get_magic_quotes_gpc()) { $_POST['username'] = addslashes($_POST['username']); } $usercheck = $_POST['username']; $check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'") or die(mysql_error()); $check2 = mysql_num_rows($check); if ($check2 != 0) { die('Sorry, the username '.$_POST['username'].' is already in use.'); } $_POST['password'] = md5($_POST['password']); if (!get_magic_quotes_gpc()) { $_POST['password'] = addslashes($_POST['password']); $_POST['username'] = addslashes($_POST['username']); } $insert = "INSERT INTO users (username, password, email) VALUES ('".$_POST['username']."', '".$_POST['password']."', '".$_POST['email']."')"; $add_member = mysql_query($insert); ?>
Cluster
Administrator
Posts: 1,283
Location: Salzburg/Österreich
Occupation: Student/Software Engineer
2
Saturday, February 16th 2008, 4:23pm
if (isset($_POST['submit'])) {