require_once('./Connections/KartConnect.php'); require_once("./includes/functions.inc"); require_once('./includes/sajax.php'); function check_exist($US_username,$US_email,$US_name,$US_business,$US_password) { global $KartConnect; require_once('./Connections/KartConnect.php'); require_once('Connections/KartConnect.php'); $query_user = "SELECT * FROM US_users WHERE US_username = '".$US_username."' "; $find_user = $KartConnect->SelectLimit($query_user) or die($KartConnect->ErrorMsg()); $totalRows_user = $find_user->RecordCount(); if ($totalRows_user>0) { return "NOT"; } else { return "OK"; } } sajax_init(); sajax_export("check_exist"); sajax_handle_client_request(); $SAJAX_JS = sajax_get_javascript(); if (isset($_REQUEST['logout']) && ($_REQUEST['logout']==1)) { unset($_SESSION); session_destroy(); } if (isset($_POST['request_password'])) { $query_user = "SELECT * FROM US_users WHERE US_email = '".$_POST['req_email']."' "; $find_user = $KartConnect->SelectLimit($query_user) or die($KartConnect->ErrorMsg()); $totalRows_user = $find_user->RecordCount(); if ($totalRows_user==0) { $_SESSION['message']="Sorry, but user with this email doesn't exist, please try again"; } else { $_SESSION['message']="The password was sent to your email"; $email_body="Hello, ".$find_user->Fields('US_name')."\r"; $email_body.="You are receiving this email because you have asked for a forgotten password for the stillmedia account.\r"; $email_body.="Your password is: ".$find_user->Fields('US_password').""; $headers="From: info@stillmedia.com"; mail($find_user->Fields('US_email'),"This is your password from http://stillmedia.com",$email_body,$headers); } } if (!isset($_SESSION['before_login'])) { $_SESSION['before_login']=$_SERVER['HTTP_REFERER']; } if ((strpos(" ".$_SERVER['HTTP_REFERER'],"frame_top.htm")>0) || (strpos(" ".$_SERVER['HTTP_REFERER'],"lb_inst.html")>0) ) { $_SESSION['before_login']='p-search.html';} session_register('keyword');?>