CCbill Jpost Implementation help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freecartoonporn
    Confirmed User
    • Jan 2012
    • 7683

    #1

    CCbill Jpost Implementation help needed

    PHP Code:
    <?
    include('db.php');
    $SUCCESS = '111';
    $FAILURE = '000';
    
    if($_POST[action] == 'ADD') {
        $result = mysql_query("SELECT * FROM users WHERE username = '$_POST[username]'");
        if(mysql_num_rows($result) > 0) {
            if(mysql_query("UPDATE users SET premium = 1 WHERE username = '$_POST[username]'")) {
                echo $SUCCESS;
            }
            else {
                echo $FAILURE;
            }
        }
        else {
            if(mysql_query("INSERT INTO users (username, password, premium) VALUES ('$_POST[username]', '$_POST[password]', 1)")) {
                echo $SUCCESS;        
            }
            else {
                echo $FAILURE;
            }
        }
    }
    if($_POST[action] == 'REMOVE') {
        if(mysql_query("UPDATE users SET premium = 0 WHERE username = '$_POST[username]'")) {
            echo $SUCCESS;
        }
        else {
            echo $FAILURE;
        }
    }
    ?>

    previously this was working fine but now it doesnt work,



    every time i am doing test signups data is posted in my db correctly but i am getting email saying.

    "We were unable to add a user to your website utilizing the CCBill User Management System. We have billed the user, but the user authentication information needs to be added to the corresponding website or their subscription will be cancelled."

    I even checked with replacing $_POST with $_GET and sending values it gives "111" as response means success.

    I guess something is wrong at your side.
    Help needed, thanks
    Last edited by freecartoonporn; 10-23-2012, 02:36 AM.
    SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean
  • FINESEC
    Registered User
    • Nov 2012
    • 59

    #2
    First of all this code is vulnerable to sql injection. The other problem with your code is that you should probably do some error logging.
    You might be interested in checking out our authentication software - we offer free installation and support:
    demo.sitedefensor.com
    sitedefensor.com
    http://SiteDefensor.com - secure authentication, password cracking and sharing prevention, site ripping protection
    http://SiteCaptcha.com - free, secure and simple CAPTCHA solution

    Comment

    • CurrentlySober
      Too lazy to wipe my ass
      • Aug 2002
      • 38943

      #3
      I cant help with ccBill, but can help with iBill if needed?

      Let me know?


      👁️ 👍️ 💩

      Comment

      Working...