Pixel to Credit Exchange (Needs Codes)

Results 1 to 9 of 9
  1. #1
    Elite Member DaEternity is offline
    Member +Rank
    Dec 2010 Join Date
    EngladLocation
    123Posts

    config Pixel to Credit Exchange (Needs Codes)

    Ive Seen some Hotel try to make a Pixels to Credits Exchange form and Fail :P So i decided i would give it a Try and so far about 85% done! But i find 2 things that are Errors and since ima Noobie and PHP still i need 2 simple Codes listed below maybe one of you can Code :)

    This Idea greatly interest's users and Makes them stay on Longer to gain more Pixels.
    1) The Get USER_ID Code
    2) A Code that makes the user not able to Exchange if they have less than 10,000 or whatever Pixel Cost you decide.

    Here is a Screenshot.


    Since i have to Do my Homework at the Moment cause its already late i dont have the Time to put a Download pack but when Codes are found to make it Fully work then i will put in codes and put download link.


    The Needed USER_ID Code tells PHP Code which User Table to Update Pixel and Credit Amount.

    The Dont allow USER_ID Code under 10,000 Pixels will stop users from having Abnormally Large amount of Credits and Abnormally Amount of negative pixels (-980,000 Pixels)
    Last edited by DaEternity; 13-01-11 at 10:31 PM.


  2. #2
    Live Ocottish Sverlord Joopie is online now
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: Pixel to Credit Exchange (Needs Codes)

    ... Easy?, that's done with a few minites.
    From mobile

  3. #3
    Elite Member nederlander is offline
    Member +Rank
    May 2007 Join Date
    201Posts

    Re: Pixel to Credit Exchange (Needs Codes)

    Quote Originally Posted by joopie View Post
    ... Easy?, that's done with a few minites.
    From mobile
    There are people who can't get that done in a few minutes?

    Nice dev mate

  4. #4
    Elite Member DaEternity is offline
    Member +Rank
    Dec 2010 Join Date
    EngladLocation
    123Posts

    Re: Pixel to Credit Exchange (Needs Codes)

    Quote Originally Posted by joopie View Post
    ... Easy?, that's done with a few minites.
    From mobile
    Like i said i still am a Noob PHP Coder. Second why havent i seen hotels with the Code to do so? if its So Easy why dont u help me and Everyone else with this Development

  5. #5
    Clean Title For Xen vLife is offline
    Super ModRank
    Apr 2009 Join Date
    The BahamasLocation
    3,814Posts

    Re: Pixel to Credit Exchange (Needs Codes)

    Quote Originally Posted by DaEternity View Post
    Like i said i still am a Noob PHP Coder. Second why havent i seen hotels with the Code to do so? if its So Easy why dont u help me and Everyone else with this Development
    Cause anyone can make PHP Pages and throw a itsy bitsy design on it with no actual coding.

  6. #6
    Live Ocottish Sverlord Joopie is online now
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: Pixel to Credit Exchange (Needs Codes)

    Here it is.

    Don't blame with my code or it doesn't work.
    Because this is not tested.
    Errors? fix it self, this is only a base of whatever.

    PHP Code:
    if (isset($_POST['submit']))
    {
        
    $error 0;
        if (!empty(
    $_POST['pixels']))
        {
            
    $pixels $_POST['pixels'];
        }
        else
        {
            
    $error 1;
        }
        if (!
    $error)
        {
            
    $oldpixels mysql_result(dbquery("SELECT `pixels` FROM `users` WHERE `id` = '".USER_ID."' LIMIT 1"), 0);
            if (
    $oldpixels <= $pixels//Idk if this right, because i always mix the > and < ...
            
    {
                
    $newcredits $pixels 10;
                
    $users->givecredits(USER_ID$newcredits);
                
    $newpixels $oldpixels $pixels;
                
    dbquery("UPDATE `users` SET `pixels` = '".$newpixels."' WHERE `id` = '".USER_ID."' LIMIT 1");
            }
            else
            {
                
    $error 1;
            }
        }
        
        if (
    $error)
        {
            
    //go to error page, or what you want
            
    header("location: http://".WWW."/your page error.php");
            exit;
        }
        
        
    //go to succes page, or what you want
        
    header("location: http://".WWW."/your page succes.php");
        exit;

    Last edited by Joopie; 14-01-11 at 09:50 AM.

  7. #7
    ☮TAKU???? seanrom is offline
    Grand MasterRank
    Nov 2009 Join Date
    1,004Posts

    Re: Pixel to Credit Exchange (Needs Codes)

    I think its great, people who is here to flame threads please leave? :)

  8. #8
    Elite Member DaEternity is offline
    Member +Rank
    Dec 2010 Join Date
    EngladLocation
    123Posts

    Re: Pixel to Credit Exchange (Needs Codes)

    Quote Originally Posted by joopie View Post
    Here it is.

    Don't blame with my code or it doesn't work.
    Because this is not tested.
    Errors? fix it self, this is only a base of whatever.

    PHP Code:
    if (isset($_POST['submit']))
    {
        
    $error 0;
        if (!empty(
    $_POST['pixels']))
        {
            
    $pixels $_POST['pixels'];
        }
        else
        {
            
    $error 1;
        }
        if (!
    $error)
        {
            
    $oldpixels mysql_result(dbquery("SELECT `pixels` FROM `users` WHERE `id` = '".USER_ID."' LIMIT 1"), 0);
            if (
    $oldpixels <= $pixels//Idk if this right, because i always mix the > and < ...
            
    {
                
    $newcredits $pixels 10;
                
    $users->givecredits(USER_ID$newcredits);
                
    $newpixels $oldpixels $pixels;
                
    dbquery("UPDATE `users` SET `pixels` = '".$newpixels."' WHERE `id` = '".USER_ID."' LIMIT 1");
            }
            else
            {
                
    $error 1;
            }
        }
        
        if (
    $error)
        {
            
    //go to error page, or what you want
            
    header("location: http://".WWW."/your page error.php");
            exit;
        }
        
        
    //go to succes page, or what you want
        
    header("location: http://".WWW."/your page succes.php");
        exit;

    Thanks! I will try this!

  9. #9
    sexiess is a sin. Subway is offline
    Grand MasterRank
    Jun 2010 Join Date
    2,491Posts

    Re: Pixel to Credit Exchange (Needs Codes)

    omg this is the cheeze!



Advertisement