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