Jump to content

Mail query issue


Sinikka

Recommended Posts

On our site we have a mail system where you can accept mails from people who are on your buddy list and the problem I'm having is I can't get it to allow mail from the buddies to go through. It's acting as though the two people aren't on each others list when they are.

Any help or suggestions anyone has would be greatly appreciated.

 

$userid is used throughout the coding to pull the individuals info and is defined in the global file.

$rank is used throughout the coding to define what rank the person has on the site and is defined in the global file.

 

$send_to = strtolower(ereg_replace(" ","",$send_to));
$findTo = fetch("SELECT id,display_name,premium,rank,username FROM members2 WHERE username = '$send_to' AND game = '$game'");
if (!$findTo[id]) { die(header(error("mail_send.php?game=$game&type=$type&id=$id", "The user you are trying to send this to does not exist."))); }
$findTo2 = fetch("SELECT mail_settings FROM members_profiles2 WHERE username = '$findTo[username]' AND game = '$game'");
if (($findTo2[mail_settings] == 1)  && ($rank <= 3))
{
$findBud = fetch("SELECT id FROM buds2 WHERE bud_me = '$userid' AND bud_you = '$findTo[id]' AND game = '$game'");

if (!$findBud[id])
{
	die(header(error("mail_send.php?game=$game&type=$type&id=$id", "Sorry, that user only accepts messages from their buddies.")));     
}
}

Link to comment
https://forums.phpfreaks.com/topic/115539-mail-query-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.