My site is a b2b trade portal. A member can select their favorite categories and when another member posts in those categories they are supposed to get an internal message and an email alert.
I have had several code fixes and changes so I don’t know what happened but neither of these is happening.
I think maybe it has to do with sessions.php but I am not sure. This is in my template code but when I look in temporary internet file I do not see a cookie from my site being created.
<?php
include_once “myconnect.php”;
include_once “session.php”;
include_once “styles.php”;
include_once “left_mem.php”;
include_once “date_time_format.php”;
include_once “send_alerts.php”;
if(isset($_COOKIE["b2b_blead_user"]))
{
$username=$_COOKIE["b2b_blead_user"];
$sql=”SELECT * FROM b2b_members WHERE sb_username = ‘$username’” ;
$rs_query=mysql_query($sql);
if ( $rs=mysql_fetch_array($rs_query) )
{
$_SESSION["b2b_username"]=$rs["sb_username"] ;
$_SESSION["b2b_userid"]=$rs["sb_id"] ;
$_SESSION["b2b_memtype"]=$rs["sb_memtype"];
}
}
//include_once “check_msg_function.php”;
$config=mysql_fetch_array(mysql_query(“select * from b2b_config “));
//======================code here is equivalent to chron file code=============================
mysql_query(“update b2b_members set sb_memtype=”.$config["sb_memtype"].” where sb_expiry_date < NOW()”);
if(date(“Ymd”,time())>$config["sb_last_sent"])
{
//echo “working”;
send_mail_alerts();////
mysql_query(“update b2b_config set sb_last_sent=”.date(“Ymd”,time()).” where 1″);
}
The send_alert to the user email is supposed to happen when a member posts an sell offer and I can see the code in that file post_offers.php
I am not a coder so I can’t say what the cause is . I need the site to be debugged and fixed.
Thanks,
Kelark