[Release] PHP - serial generator

Results 1 to 7 of 7
  1. #1
    Account Upgraded | Title Enabled! Duong Phan is offline
    MemberRank
    Sep 2012 Join Date
    VNLocation
    203Posts

    [Release] PHP - serial generator

    Index.html

    Code:
    <html>
    <head>
    <title>Like to get Free Serail zGate War Z</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body>
        <div id="contentunlock">
    				<form method='post' action='reg.php'>
    				<p><label for="accountName" class="label">Email</label><input class='input' type='text' name='useremail' id='useremail' style='width:220px;' autocomplete="off" onpaste="return false;" maxlength="320" required="required" placeholder="E-mail" />
    				<span id="statusmail"></span>
    				</p>
    				<p><button class="ui-button button1 " type="submit" data-text="Processing…"><span><span>Get Free Serial</label></label></button></p>
                    </form>
    	</div>
    </body>
    </html>

    reg.php

    PHP Code:
    <?php
    require_once('config.php');
    $useremail=$_POST['useremail'];
    $userip $_SERVER['REMOTE_ADDR'];
    $chars = array(0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
    $serial '';
    for(
    $i=0;$i<25;$i++)
    {
        
    $serial .= (!($i 5) && $i '-' '').$chars[rand(0, (count($chars)-1))];
    }
    $mdate date('Y-m-d H:i:s'time());
    if (
    filter_var($useremailFILTER_VALIDATE_EMAIL)) {
            
    $suserExists sqlsrv_num_rows(sqlsrv_query$sqlLink"select * from WarZSerials where email = '$useremail'"$params$options));
                if(
    $suserExists 0){
                    die(
    '<script>alert("Email used by another user.");history.go(-1);</script>');
                }
                else 
                {
                
    sqlsrv_query($sqlLink"INSERT INTO WarZSerials (SerialKey,SerialType,IsUsed,email) VALUES ('$serial',2,1,'$useremail')", array());
                
    sqlsrv_query($sqlLink"INSERT INTO WarZPreorders (OrderDate,ReferrerName,Method,Amount,OrderID,ApprovalCode,email,AccountType,Serial1,Serial2,Serial3,Serial4,ClientIP) values ('$mdate','paypal','PayPal',99,'1',' ','$useremail',2,'$serial','','','','$userip')");
                }
                echo 
    "Date: "; echo $mdate;
                echo 
    '<br>';
                echo 
    "Email: "; echo $useremail;
                echo 
    '<br>';
                echo 
    "IP: "; echo $userip;
                echo 
    '<br>';
                echo 
    "Serial: "; echo $serial;
    }
    else {
        die(
    '<script>alert("Please check your email address.");history.go(-1);</script>');
    }

    ?>
    config.php

    PHP Code:
    <?php
    $cfg
    ['sql_host'] = "ZGATE\SQLEXPRESS";
    $cfg['sql_user'] = "sql user";
    $cfg['sql_pass'] = "sql pass";
    $cfg['sql_db'] = "breezenet";
    $cfg['connInfo'] = array("UID"=>$cfg['sql_user'], 
                        
    "PWD"=>$cfg['sql_pass'],
                        
    "Database"=>$cfg['sql_db'],
                        
    "ReturnDatesAsStrings"=> true);
                        
    $sqlLink sqlsrv_connect($cfg['sql_host'], $cfg ['connInfo']);
        if(
    $sqlLink === false)
        {
            die(
    "MSSQL server is not accessable, why should we try to select database ?");
        }
    $params = array();
    $options =  array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
    date_default_timezone_set('Asia/Ho_Chi_Minh');
    $timestamp time();

    $day date("d",$timestamp);
    $month date("m",$timestamp);
    $year date("Y",$timestamp);
    ?>


  2. #2
    ¿ aLca is offline
    MemberRank
    Apr 2013 Join Date
    /dev/nullLocation
    548Posts

    Re: [Release] PHP - serial generator

    /Bump - it's the best script for it actually.

    Ty for sharing dude!

  3. #3
    Member Aske1gt is offline
    MemberRank
    Aug 2011 Join Date
    52Posts

    Re: [Release] PHP - serial generator

    Getting this error :/

    Fatal error: Call to undefined function sqlsrv_connect() in C:\xampp\htdocs\XXXX\serialgen\config.php on line 11

    EDIT: Everything is fixed, great release. :)
    Last edited by Aske1gt; 17-06-13 at 10:42 PM.

  4. #4
    Proficient Member MadScripter is offline
    MemberRank
    Apr 2013 Join Date
    187Posts

    Re: [Release] PHP - serial generator

    Quote Originally Posted by Aske1gt View Post
    Getting this error :/

    Fatal error: Call to undefined function sqlsrv_connect() in C:\xampp\htdocs\XXXX\serialgen\config.php on line 11
    You need the sqlsrv / mssql extension for PHP.

  5. #5
    Member Aske1gt is offline
    MemberRank
    Aug 2011 Join Date
    52Posts

    Re: [Release] PHP - serial generator

    Hi MadScripter, could you give me a link where i can download it? :)

    EDIT: Got it to work, but now it doesn't want to connect to my DB, i typed in every thing i needed except the password, left it blank, as i diden't have any password on that user. (Anyone that could help?)

    This just shows: "MSSQL server is not accessable, why should we try to select database ?"

    EDIT: Everything is fixed, great release. :D
    Last edited by Aske1gt; 17-06-13 at 10:42 PM.

  6. #6
    Account Upgraded | Title Enabled! Dragonbooss is offline
    MemberRank
    May 2013 Join Date
    BrazilLocation
    267Posts

    Re: [Release] PHP - serial generator

    Fatal error: Call to undefined function sqlsrv_connect() in /home/a3914992/public_html/Gerador/config.php on line 11

    Help?

  7. #7
    Omega Ron is offline
    MemberRank
    Apr 2005 Join Date
    Location
    8,990Posts

    Re: [Release] PHP - serial generator

    Quote Originally Posted by Dragonbooss View Post
    Fatal error: Call to undefined function sqlsrv_connect() in /home/a3914992/public_html/Gerador/config.php on line 11

    Help?
    Look literally 3 posts above yours, god damn.



Advertisement