Help with this CUSTOM php script!

Results 1 to 3 of 3
  1. #1
    Enthusiast Sharelogin is offline
    MemberRank
    Dec 2010 Join Date
    31Posts

    note Help with this CUSTOM php script!

    Hello i tryed to edit the register page written by Wizkid, to create a buy colour name script..



    i created dbo.colourname 2.. but if how i make the script if people typ hes username than it comes to dbo.colourname and not to dbo.account or dbo.login i need this because there is not a script from setting urgade 1 if people buy colourname ( my ugrade 1 is donator grade ), so i if guys buy colour name than comes to dbo.colourname than i can send they colourgrade! here is the script! PLEASEE HELP: green.gunz@hotmail.com @!!@@

    <?php
    /*
    Original by Wizkid,
    Captcha added by Phoenix,
    Completely reworked by Aaron (zyberscape) with LegacyGamers.net
    */
    $dns="GreenGunzDB";
    $user="sa";
    $pass="************";
    $connect = odbc_connect($dns, $user, $pass) or die ("Couldn't connect to the database...");
    $select_db = odbc_exec($connect, "use GunzDB");




    function cleanup($info){
    $info = stripslashes($info);
    $info = htmlspecialchars($info);
    return $info;
    }
    function doesUsercolournameExist($colourname){
    $exit = FALSE;
    $result = @odbc_exec($connect, "SELECT UserID FROM Account WHERE UserID='".$colourname."'");
    if(odbc_num_rows($result) != 0){
    $exit = TRUE;
    }
    else{
    $exit = FALSE;
    }
    return $exit;
    }


    if(isset($_POST['register'])){
    $securimage = new Securimage();
    if(empty($_POST['usercolourname']) || strlen($_POST['usercolourname']) > 25){ //reasonable
    $errormsg.="No usercolourname filled or too long.<br>";
    }
    if(empty($_POST['colourname']) || strlen($_POST['colourname']) > 50){ //again set a resonable limit..
    $errormsg.="No colourname filled or colourname is FAR too long.<br>";
    }
    //
    if(!empty($errormsg)){
    echo "<div>There were some problems with buying colour name:<br>".$errormsg."</div>";
    exit();
    }
    else {
    $usercl = cleanup($_POST['usercolourname']);
    $colournamecl = cleanup($_POST['colourcolourname']);
    if(doesUsercolournameExist($usercl)){ //username is taken
    echo "<div style=\"font-weight: bold;\">Only Yellow colourname.</div>";
    exit();
    }
    else {
    $insert_account = odbc_exec($connect, "INSERT INTO Account (UserID, UGradeID, PGradeID, RegDate, Email, Age, colourname) VALUES ('".$usercl."', '0', '0', '".date("Y-m-d H:i:s")."', '".$_POST['email']."', '".$_POST['age']."', '".$colournamecl."')");

    $get_aid = odbc_fetch_array(odbc_exec($connect, "SELECT AID FROM Account WHERE UserID='".$usercl."'"));

    $inster_login = odbc_exec($connect, "INSERT INTO Login (UserID, AID, Password) VALUES ('".$usercl."', '".$get_aid['AID']."', '".$colournamecl."')");
    echo '<div align="center">Your account is succesfully created with the colourname '.$usercl.'!</div>';
    exit();
    }
    }
    }
    ?>
    <!DOCTYPE html>
    <head>
    <title>Green Gunz Buying Colour Name</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <div style="font-weight:bold;">You can buy a colour name right heree:<br></div>
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
    <table>
    <tr>
    <td>Username</td>
    <td><input type="text" username="username" maxlength="25" /></td>
    </tr>
    <tr>
    <td>Colour: Yellow</td>
    </tr>
    <tr>
    <td width="434" colspan="2"><hr color="#323232" width="96%"></td>
    </tr>
    <tr>
    <td align="center" colspan="2"><input type="submit" colourname="register" value="Buy Colourcolourname!" /></td>
    </tr>
    </table>
    </form>
    </body>
    </html>



    <SCRIPT language="JavaScript">
    <!--
    //Disable right click script
    var message="";
    ///////////////////////////////////
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
    document.oncontextmenu=new Function("return false")
    // -->
    </SCRIPT>

    <META HTTP-EQUIV="imagetoolbar" CONTENT="no">


    PLEASE HELP, sorry for bad english


  2. #2
    Apprentice Shotacat is offline
    MemberRank
    Jun 2004 Join Date
    RussiaLocation
    19Posts

    Re: Help with this CUSTOM php script!

    odbc_num_rows - this function depends to odbc driver and afaik it does not work with mssql odbc driver. And check if custom columns like 'colourname' exist in your tables.
    Last edited by Shotacat; 26-01-11 at 05:43 AM.

  3. #3
    Account Upgraded | Title Enabled! BGRick is offline
    MemberRank
    Oct 2010 Join Date
    The NetherlandsLocation
    437Posts

    Re: Help with this CUSTOM php script!

    Quote Originally Posted by zazaza View Post
    odbc_num_rows - this function depends to odbc driver and afaik it does not work with mssql odbc driver. And check if custom columns like 'colourname' exist in your tables.
    People have to login there and choose a color?

    Like...

    Character Name: namehere
    Color: Gold

    BUY BUTTON > redirect to PayPal payment
    But how u gonna check the payments?
    If they click on BUY and then it changes to like ugrade 25 = gold

    I think you can better do:

    Make a php file with any name .php
    Then make a FAQ/GUIDE how they can get there color.
    Put a PayPal button on it.
    BE sure afther the payment succesfulled they redirect to ex. eCommerce and Web Hosting from YourSite.Com
    Make it a lot of 9834237 because then people think it is specially for them.
    In that site you put a login ID and the color they want to have.
    Then they click confirm and there ugrade got changed.

    Good idea or not ?




Advertisement