[HELP] Registration Website!

Results 1 to 5 of 5
  1. #1
    Enthusiast weijian95 is offline
    MemberRank
    Apr 2007 Join Date
    Infront of my com :DLocation
    45Posts

    [HELP] Registration Website!

    [QUOTE=bepetemish;1859864]Q. 2.2 How to make a register website?
    A.
    <Version 2.1; Credits to: Kentucky & snaity>

    1) Download wamp. (wamp allows to run a website on your computer. a = apache)
    WAMP

    2) Install it.
    Click:
    Next >
    I Accept -> Next >
    Install to "c:\wamp"
    Next >
    Next >
    Next >
    Install

    3) It will now Install, click ok with each popup that comes up.

    4) Click Launch WAMP now, then click OK.

    5) Go to:
    C:\wamp\php\php.ini

    6) Find the line ;extension=php_mssql.dll and remove the ;

    7) Click the WAMP icon then click "Put Online"

    8) Go to c:\wamp\www and delete everything in there.

    9) Right Click -> New -> File -> index.php

    10) Right Click index.php -> Open With -> Notepad

    11) Copy In:

    PHP Code:
    [LEFT] [COLOR=#000000] <html>
    <head>
    <title>GunZ User Account Register</title>
    <style>
    body {
    color: #003300;
    font-family: Verdana, Arial, Serif;
    font-size: 10pt;
    }
    input {
    border: 1px solid #003300;
    color: #003300;
    background: #DDDDDD;
    font-family: Verdana, Arial, Serif;
    font-size: 10pt;
    }
    tr {
    font-size: 10pt;
    }
    a:link {
    text-decoration: none;
    color: #003300;
    }
    a:visited {
    text-decoration: none;
    color: #003300;
    }
    a:active {
    text-decoration: none;
    color: #003300;
    }
    a:hover {
    text-decoration: none;
    color: #FF6600;
    }
    </style>
    </head>
    <body>
    <div align="center">
    <?php
    $srvip
    = "snaity.no-ip.org";
    $srvport = "6000";
    $mssql_user = "sa";
    $mssql_pass = "******";
    $mssql_database = "gunzsrv";
    $mssql_host = "LOCALMACHINE\SQLEXPRESS";
    $conn = mssql_connect($mssql_host, $mssql_user, $mssql_pass);
    mssql_select_db($mssql_database);
    ?>
    <FORM METHOD=POST ACTION="<?php echo $_SERVER['PHP_SELF']; ?>?act=register">
    <table cellspacing=0 border=0>
    <tr>
    <td colspan=2 style="border: 1px solid #003300; background: #DDDDDD;"><CENTER><A rel="nofollow" HREF="<?php echo $_SERVER['PHP_SELF']; ?>">GunZ User Account Register</A></CENTER></td>
    </tr>
    <tr>
    <td style="border-left: 1px solid #003300">User ID:</td>
    <td style="border-right: 1px solid #003300"><INPUT TYPE="text" NAME="login"></td>
    </tr>
    <tr>
    <td style="border-left: 1px solid #003300">Password:</td>
    <td style="border-right: 1px solid #003300"><INPUT TYPE="password" NAME="senha1"></td>
    </tr>
    <tr>
    <td style="border-left: 1px solid #003300">Retype Password:</td>
    <td style="border-right: 1px solid #003300"><INPUT TYPE="password" NAME="senha2"></td>
    </tr>
    <tr>
    <td style="border-left: 1px solid #003300">Email:</td>
    <td style="border-right: 1px solid #003300"><INPUT TYPE="text" NAME="email"></td>
    </tr>
    <tr>
    <td style="border: 1px solid #003300; border-top: 0px;" colspan=2><CENTER><INPUT NAME="Cadastrar" VALUE="Cadastrar" TYPE="submit"></CENTER></td>
    </tr>
    </table>
    </FORM>
    <?php

    if ($_GET['act'] == 'register')
    {
    $user = anti_injection($_POST['login']);
    $pass1 = anti_injection($_POST['senha1']);
    $pass2 = anti_injection($_POST['senha2']);
    $email = anti_injection($_POST['email']);
    if (
    valida(Array($user,$pass1,$pass2,$email)) == true)
    {
    if (
    $pass1 == $pass2)
    {
    if (
    ereg("([0-9,a-z,A-Z])", $user))
    {
    if (
    ereg("^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$", $email))
    {
    $query = mssql_query("SELECT * FROM Accounts WHERE UserID='$user'");
    $num_rows = mssql_num_rows($query);
    if (
    $num_rows == 0)
    {
    $query = mssql_query("SELECT * FROM Accounts WHERE E_Mail='$email'");
    $num_rows = mssql_num_rows($query);
    if (
    $num_rows == 0)
    {
    $query = mssql_query("INSERT INTO Accounts (UserID, Password, E_Mail) VALUES ('$user','$pass1','$email')");
    if (!
    $query)
    {
    echo
    ":: Error on account register try later ::<br>";
    }
    else
    {
    echo
    ":: Account has been registered ::<br>";
    }
    }
    else
    {
    echo
    ":: Email in use ::<br>";
    }
    }
    else
    {
    echo
    ":: User in use ::<br>";
    }
    }
    else
    {
    echo
    ":: Invalid Email ::<br>";
    }
    }
    else
    {
    echo
    ":: Only use Numbers and Letters in User ID ::<br>";
    }
    }
    else
    {
    echo
    ":: Password not equal with other ::<br>";
    }
    }
    }

    $query = mssql_query("SELECT * FROM Accounts");
    $num_rows = mssql_num_rows($query);
    echo
    "Total Accounts: ".$num_rows."<br>";

    echo
    "<br>Server Status: ";
    $fp = @fsockopen($srvip, $srvport, $errno, $errstr, 1);
    if (!
    $fp) {
    echo
    "<font style='color: #FF3300'>Offline</br>";
    } else {
    echo
    "<font style='color: #009933'>Online</br>";
    fclose($fp);
    }

    [COLOR=#FF8000]// Fun
    Last edited by weijian95; 04-06-07 at 01:13 PM.


  2. #2
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: [HELP] Registration Website!

    In mssql studio managment

    In the table account

    And yes edit the part of mssql server usernam,password and databasename

  3. #3
    Enthusiast weijian95 is offline
    MemberRank
    Apr 2007 Join Date
    Infront of my com :DLocation
    45Posts

    Re: [HELP] Registration Website!

    How about the TCP 80 on firewall? But anyway, my firewall is off and I'm using Norton AntiVirus's Internet Worm Protection, so wad must i do?

  4. #4
    Enthusiast weijian95 is offline
    MemberRank
    Apr 2007 Join Date
    Infront of my com :DLocation
    45Posts

    Re: [HELP] Registration Website!

    Thank you for your idea! Now I made my signature with a search button!

  5. #5
    Enthusiast weijian95 is offline
    MemberRank
    Apr 2007 Join Date
    Infront of my com :DLocation
    45Posts

    Re: [HELP] Registration Website!

    Help me with this pls!

    -----------------------
    FIXED! THANKS TO ROTANA AGAIN! FOR THOSE WHO HAVE THIS PROBLEM, DOWNLOAD THIS AND REPLACE IT IN
    Code:
    C:\wamp\Apache2\bin
    ! TRY IN LOCALHOST TO CHECK WHETHER IT WORKED! WORKED FINE FOR ME!
    Credits to Rotana
    Last edited by weijian95; 07-06-07 at 03:20 AM. Reason: FIXED



Advertisement