Hi!
Im trying to build a page where you can place ads for a small amount. First you have to pay and then you get to create your ad. But after creating the ad I always get the message that "the site has not received your payment" and users is unable to create ad.
This is the area in the code that produces the error message:
// Get the row from the users table
if ( $ad_cost > 0 )
{
$sql = "SELECT *
FROM ". ADS_USERS_TABLE ."
WHERE users_user_id = ".$userdata['user_id'];
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
if ( !$row )
{
message_die(GENERAL_ERROR, $lang['no_credit']);
}
// Check for sufficient credit
if ( $ad_cost > $row['users_balance'] )
{
message_die(GENERAL_ERROR, $lang['insuffient_credit']);
}
}
// Create the ad
$user_ip = $userdata['session_ip'];
$time = time();
$expiry_date = mktime(0, 0, 0, date("m") + $ad_duration, date("d"), date("Y"));
$status = 'active';
// Insert for the adverts table
$sql = "INSERT INTO ". ADS_ADVERTS_TABLE ." (category, sub_category, ad_type_code, basic_ad_ind, standard_ad_ind, photo_ad_ind, premium_ad_ind, ad_cost, user_id, username, user_ip, time, title, short_desc, price, status, expiry_date, trade_ind, loc_id)
VALUES ('$category', '$sub_category', '$ad_type_code', '$basic_ad_ind', '$standard_ad_ind', '$photo_ad_ind', '$premium_ad_ind', $ad_cost, '$user_id', '$username', '$user_ip', '$time', '$title', '$short_desc', '$price', '$status', '$expiry_date', '$trade_ind', '$locnum')";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert adverts row', '', __LINE__, __FILE__, $sql);
}
$id = $db->sql_nextid();
Since I am no programmer I dont know if this problem is related to the code or if this is a paypal issue thing. The money is in my account so that works, but the software still refuses to create an ad.
I would appreciate any help!