Welcome!

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!

Web Need Simple CMS!

Newbie Spellweaver
Joined
Jan 17, 2016
Messages
9
Reaction score
0
- i need a simple cms, for only register, someone can help-me? thanks! :eek:tt:
- Im using LeaderMs Source v62.
 
Experienced Elementalist
Joined
Nov 21, 2008
Messages
297
Reaction score
38
I would take the register page out of an available cms and make that into the index.php
Or google a registration script and edit it to fit your database/tables
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
Link NOT Working :/

register.php:
PHP:
<!-- 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>

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);
?>
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Nov 14, 2008
Messages
1,025
Reaction score
641
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);
?>

why u giving him german bro?
 
Upvote 0
Joined
Sep 8, 2011
Messages
822
Reaction score
129
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);
?>
I wouldn't use that, it's completely unsafe, also turning error reporting off is very discouraged, MySQL_*() is deprecated and unsafe.
Also never trust POST, GET or any other user data sent to you, escape it and make sure you take every precaution possible, otherwise your entire database can be deleted by malicious SQL injection :D:

On topic:
Try learning the basics of PHP from
Although learning from CodeCademy will give you the basics, it will suffice for the purpose you're learning it (MapleStory websites).
Good luck :):
 
Upvote 0
Back
Top