Help Сreate a script for registration mssql.php

Results 1 to 4 of 4
  1. #1
    Valued Member ranaza is offline
    MemberRank
    Aug 2012 Join Date
    JapanLocation
    105Posts

    Help Сreate a script for registration mssql.php

    Help Сreate a script for registration mssql.php
    Please help create a mssql.php under this registration code

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <?php
    include "MSSql.php";

    $db = "PassportBOI";
    $host = "IP\\SQLEXPRESS";
    $user = "sa";
    $password = "password";

    $cMSSql = new MSSql($db,$host,$user,$password);

    if($_POST)
    {
    $username = $_POST["username"];
    $pwd = $_POST["pwd"];
    $repwd = $_POST["repwd"];
    $creatime = date("Y-m-d H:i:s");

    if($username > 3)
    {
    echo"<script>alert('Need Username over 3 char.');history.back();</script>";
    exit() ;
    }

    if((isset($pwd)) and ($pwd!=$repwd))
    {
    echo"<script>alert('Password wrong.');history.back();</script>";
    exit() ;
    }

    if(!eregi("^([a-zA-Z0-9])*$",$username))
    {
    echo"<script>alert('Username have been a-z, A-Z, 0-9 only.');history.back();</script>";
    exit() ;
    }


    //declare the SQL statement that will query the database
    $rows = $cMSSql->quick_num("SELECT name FROM account WHERE name='$username'");
    $idCount = $cMSSql->quick_num("SELECT name FROM account");
    if($rows>0)
    {
    echo "<script>alert('Username not ready.');history.back();</script>";
    exit();
    }
    else
    {
    $pwdx = $username.$pwd;
    //$pwdx = $pwd.$pwd;
    $Salt = md5($pwdx);
    $password = "0x".$Salt;
    $idCount = $idCount+1;

    $cMSSql->execute("
    Insert Into account
    (id,creatime,name,passwd,usertype)
    Values
    ('$idCount','$creatime','$username',$password,'1')
    ");
    echo "<script>alert('Register $username done.');history.back();</script>";
    exit();
    }

    }

    ?>
    <form action="" method="post" name ="checkForm" id="checkForm" onSubmit="return check()">
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="300" style="font-size:12px;color: #754831;">
    <tr>
    <td align="right" width="130" height="25">Username :&nbsp;&nbsp;</td>
    <td align="left" width="170" height="25"><input type="text" name="username" size="15" maxlength="12" style="width: 150px; height:20px;font-size:12px;color: #754831;"></td></tr>
    <tr>
    <td align="right" width="130" height="25">Password :&nbsp;&nbsp;</td>
    <td align="left" width="170" height="25"><input type="password" name="pwd" size="15" maxlength="18" style="width: 150px; height:20px;font-size:12px;color: #754831;"></td></tr>
    <tr>
    <td align="right" width="130" height="25">RePassword :&nbsp;&nbsp;</td>
    <td align="left" width="170" height="25"><input type="password" name="repwd" size="15" maxlength="18" style="width: 150px; height:20px;font-size:12px;color: #754831;"></td></tr>
    <tr>
    <td align="right" width="130" height="30"><input type="submit" name="Submit" value="ยืนยัน" onclick="return check_register_form()">&nbsp;&nbsp;</td>
    <td align="left" width="170" height="30">&nbsp;&nbsp;<input type="reset" name="Reset" value="ล้างค่า"></td>
    </tr>
    </table>
    </form>


  2. #2
    Member Beatz89 is offline
    MemberRank
    Oct 2012 Join Date
    United KingdomLocation
    52Posts

    Re: Help Сreate a script for registration mssql.php

    Not going to do this for you since Google is a great helping hand when it comes to PHP and MSSQL.

    Also looking at your code there are scripts about (on the forum) already which do what you need them to do.

    Please search before posting something like this.

  3. #3
    Valued Member ranaza is offline
    MemberRank
    Aug 2012 Join Date
    JapanLocation
    105Posts

    Re: Help Сreate a script for registration mssql.php

    I understand but still can not find.
    So please help.

  4. #4
    Enthusiast xsoftz is offline
    MemberRank
    Dec 2010 Join Date
    44Posts

    Re: Help Сreate a script for registration mssql.php

    hello

    how do u get code from ?



Advertisement