Need Simple CMS!

Results 1 to 9 of 9
  1. #1
    Apprentice 2410 is offline
    MemberRank
    Jan 2016 Join Date
    9Posts

    cool Need Simple CMS!

    - i need a simple cms, for only register, someone can help-me? thanks!
    - Im using LeaderMs Source v62.


  2. #2
    jRvdJxwvjhs Linkerzz is offline
    MemberRank
    Nov 2008 Join Date
    NorwayLocation
    345Posts

    Re: Need Simple CMS!

    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

  3. #3
  4. #4
    Apprentice 2410 is offline
    MemberRank
    Jan 2016 Join Date
    9Posts

    Re: Need Simple CMS!

    Link NOT Working :/

  5. #5
    Moderator Eric is offline
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    3,188Posts

    Re: Need Simple CMS!

    Quote Originally Posted by 2410 View Post
    Link NOT Working :/
    register.php:
    PHP Code:
    <!-- Re-written in HTMLoriginally 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 Code:
    <?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 Code:
       <?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);
    ?>

  6. #6
    Account Upgraded | Title Enabled! oxysoft is offline
    MemberRank
    Nov 2008 Join Date
    Canada, QCLocation
    1,400Posts

    Re: Need Simple CMS!

    Quote Originally Posted by Eric View Post
    config.php:
    PHP Code:
       <?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?

  7. #7
    very green greenelfx is offline
    MemberRank
    Jul 2011 Join Date
    1,323Posts

    Re: Need Simple CMS!

    Quote Originally Posted by oxysoft View Post
    why u giving him german bro?
    that's dutch :P

  8. #8
    Account Upgraded | Title Enabled! oxysoft is offline
    MemberRank
    Nov 2008 Join Date
    Canada, QCLocation
    1,400Posts

    Re: Need Simple CMS!

    Quote Originally Posted by greenelfx View Post
    that's dutch :P
    oh ok nvm then

  9. #9
    Account Upgraded | Title Enabled! Snopboy is offline
    MemberRank
    Sep 2011 Join Date
    Kerning PQLocation
    1,057Posts

    Re: Need Simple CMS!

    Quote Originally Posted by Eric View Post
    register.php:
    PHP Code:
    <!-- Re-written in HTMLoriginally 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 Code:
    <?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 Code:
       <?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

    On topic:
    Try learning the basics of PHP from Learn to code | Codecademy
    Although learning from CodeCademy will give you the basics, it will suffice for the purpose you're learning it (MapleStory websites).
    Good luck



Advertisement