stuartn
12-02-2007, 03:06 PM
I've decided to join two parts of my site together, so I've developed a cron within vb that sync 's the required data between the two databases. Vb is the primary login, so I'll be removing all the login's from the other part of the site. The next task and I've been reading loads of pages on this topic, but I still can't seem to get it to work.
In the other software the sessions are maintained within a func.php, obviously generated by the login.php.
So my thoery was to hook in the vb session data into the func.php, as vb stores session info in the database but maybe not so simple.
Can anyone point me in the right direction.
function chk_member_login($viewkey="")
{
global $config,$conn;
$sql="select * from signup where UID=$_SESSION[UID]";
$rs=$conn->execute($sql);
if($_SESSION['UID']=="" || $_SESSION['EMAIL']=="" || $rs->recordcount()==0)
{
$q = "";
while(list($k,$v)=each($_GET)){$q.="&$k=$v";}
$q=base64_encode($q);
if($q!="")$add="&add=$q";
$temp=$_SERVER['PHP_SELF'];
$path=explode("/",$temp);
$page=$path[count($path)-1];
$page=str_replace(".php","",$page);
header("Location:$config[baseurl]/signup.php?next=$page$add");
exit;
}
}
*/
function session_to_db()
{
global $conn;
$sql="select * from signup where UID=$_SESSION[UID]";
$rs=$conn->execute($sql);
if($rs->recordcount()>0)
{
$_SESSION[EMAILVERIFIED]=$rs->fields['emailverified'];
}
}
Any tips & code welcome please.:)
In the other software the sessions are maintained within a func.php, obviously generated by the login.php.
So my thoery was to hook in the vb session data into the func.php, as vb stores session info in the database but maybe not so simple.
Can anyone point me in the right direction.
function chk_member_login($viewkey="")
{
global $config,$conn;
$sql="select * from signup where UID=$_SESSION[UID]";
$rs=$conn->execute($sql);
if($_SESSION['UID']=="" || $_SESSION['EMAIL']=="" || $rs->recordcount()==0)
{
$q = "";
while(list($k,$v)=each($_GET)){$q.="&$k=$v";}
$q=base64_encode($q);
if($q!="")$add="&add=$q";
$temp=$_SERVER['PHP_SELF'];
$path=explode("/",$temp);
$page=$path[count($path)-1];
$page=str_replace(".php","",$page);
header("Location:$config[baseurl]/signup.php?next=$page$add");
exit;
}
}
*/
function session_to_db()
{
global $conn;
$sql="select * from signup where UID=$_SESSION[UID]";
$rs=$conn->execute($sql);
if($rs->recordcount()>0)
{
$_SESSION[EMAILVERIFIED]=$rs->fields['emailverified'];
}
}
Any tips & code welcome please.:)