Most visitors online was 11410 , on 26 Apr 2024
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!Link NOT Working :/
<!-- Re-written in HTML, originally based from PHP -->
<head>
</head>
<center>
<h1>Register</h1>
<table cellspacing=1 cellpadding=5>
<form action="register_do.php" method="POST">
<tr><td class=list align=right>Username</td><td class=list><input type=text name=name maxlength="30"></td></tr>
<tr><td class=list align=right>Password</td><td class=list><input type=password name=pass maxlength="30"></td></tr>
<tr><td class=listtitle align=center colspan=2><input type=submit name=submit value='Register'></td></tr>
</form>
</table>
<br>
</center></body></html>
<?php
error_reporting(E_ERROR | E_PARSE);
$name = $_POST['name'];
$pass = $_POST['pass'];
$password = sha1($pass);
include('config.php');
$sel = 'SELECT * FROM accounts WHERE name="'.$_POST['name'].'"';
if($name == ""){
echo '<script>';
echo 'alert("No username entered.");';
echo '</script>';
echo '<meta http-equiv="refresh" content="0; url=/register.php"/>';
exit();
return;
} else if (mysql_num_rows(mysql_query($sel)) >= 1) {
echo '<script>';
echo 'alert("The username already exists!");';
echo '</script>';
echo '<meta http-equiv="refresh" content="0; url=/register.php"/>';
exit();
return;
} else if($pass == "") {
echo '<script>';
echo 'alert("No password entered.");';
echo '</script>';
echo '<meta http-equiv="refresh" content="0; url=/register.php"/>';
exit();
return;
} else {
$d = 'INSERT INTO accounts (name, password, gm) VALUES ("'.$name.'", "'.$password.'", "0")';
mysql_query($d) OR die (mysql_error());
echo '<center><b>Your account has been created! Enjoy the game!</b></center>';
}
?>
<?php
$host['naam'] = 'localhost'; // my host
$host['gebruikersnaam'] = 'root'; // my database username
$host['wachtwoord'] = ''; // my database password
$host['databasenaam'] = 'odinms'; // my database name
$db = mysql_connect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database');
mysql_select_db($host['databasenaam'], $db);
?>
config.php:
PHP:<?php $host['naam'] = 'localhost'; // my host $host['gebruikersnaam'] = 'root'; // my database username $host['wachtwoord'] = ''; // my database password $host['databasenaam'] = 'odinms'; // my database name $db = mysql_connect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database'); mysql_select_db($host['databasenaam'], $db); ?>
that's dutchwhy u giving him german bro?
I wouldn't use that, it's completely unsafe, also turning error reporting off is very discouraged, MySQL_*() is deprecated and unsafe.register.php:
PHP:<!-- Re-written in HTML, originally based from PHP --> <head> </head> <center> <h1>Register</h1> <table cellspacing=1 cellpadding=5> <form action="http://forum.ragezone.com/register_do.php" method="POST"> <tr><td class=list align=right>Username</td><td class=list><input type=text name=name maxlength="30"></td></tr> <tr><td class=list align=right>Password</td><td class=list><input type=password name=pass maxlength="30"></td></tr> <tr><td class=listtitle align=center colspan=2><input type=submit name=submit value='Register'></td></tr> </form> </table> <br> </center></body></html>
register_do.php:
PHP:<?php error_reporting(E_ERROR | E_PARSE); $name = $_POST['name']; $pass = $_POST['pass']; $password = sha1($pass); include('config.php'); $sel = 'SELECT * FROM accounts WHERE name="'.$_POST['name'].'"'; if($name == ""){ echo '<script>'; echo 'alert("No username entered.");'; echo '</script>'; echo '<meta http-equiv="refresh" content="0; url=/register.php"/>'; exit(); return; } else if (mysql_num_rows(mysql_query($sel)) >= 1) { echo '<script>'; echo 'alert("The username already exists!");'; echo '</script>'; echo '<meta http-equiv="refresh" content="0; url=/register.php"/>'; exit(); return; } else if($pass == "") { echo '<script>'; echo 'alert("No password entered.");'; echo '</script>'; echo '<meta http-equiv="refresh" content="0; url=/register.php"/>'; exit(); return; } else { $d = 'INSERT INTO accounts (name, password, gm) VALUES ("'.$name.'", "'.$password.'", "0")'; mysql_query($d) OR die (mysql_error()); echo '<center><b>Your account has been created! Enjoy the game!</b></center>'; } ?>
config.php:
PHP:<?php $host['naam'] = 'localhost'; // my host $host['gebruikersnaam'] = 'root'; // my database username $host['wachtwoord'] = ''; // my database password $host['databasenaam'] = 'odinms'; // my database name $db = mysql_connect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database'); mysql_select_db($host['databasenaam'], $db); ?>