// ****************************************************
// *** Mysql adatbázis eléréséhez szükséges adatok ***
// ****************************************************
// -------------------mysql user-------------------
$mysqluser="buybuy";
//$mysqluser="root";
// -------------------mysql jelszó-------------------
$mysqlpwd="Y7xpn5rpeTPSnsDV";
//$mysqlpwd="titok";
// -------------------mysql adatbázis neve-------------------
$mysqldtb="buybuy";
// -------------------mysql socket-------------------
$mysqlsock="localhost";
?>
Warning: mysql_connect(): Access denied for user 'www-data'@'localhost' (using password: NO) in /www/www.buybuy.dolphinet.hu/index.php on line 31
Warning: mysql_select_db(): Access denied for user 'www-data'@'localhost' (using password: NO) in /www/www.buybuy.dolphinet.hu/index.php on line 32
Warning: mysql_select_db(): A link to the server could not be established in /www/www.buybuy.dolphinet.hu/index.php on line 32
Warning: mysql_query(): Access denied for user 'www-data'@'localhost' (using password: NO) in /www/www.buybuy.dolphinet.hu/index.php on line 35
Warning: mysql_query(): A link to the server could not be established in /www/www.buybuy.dolphinet.hu/index.php on line 35
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /www/www.buybuy.dolphinet.hu/index.php on line 36
$SID_LEN=128;
$SID_CHARS='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
mt_srand((double)microtime()*1000000);
function create_sid()
{
global $SID_LEN,$SID_CHARS;
$sid='';
for ($i=0;$i<$SID_LEN;$i++)
{
$randval = $SID_CHARS[mt_rand(0,strlen($SID_CHARS)-1)];
$sid=$sid . $randval;
}
return $sid;
}
function get_ip()
{
$ip='';
if ($_SERVER['$HTTP_X_FORWARDED_FOR']!="")
{
$ip=$_SERVER['$HTTP_X_FORWARDED_FOR'] . '-' . $_SERVER['REMOTE_ADDR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
function login($lg, $passw )
{
$sel=mysql_query("select id from users where kapcs_email='$lg' and jelszo='$passw'");
if (mysql_num_rows($sel)==0) $sid='NO';
else
{
$uid=mysql_result($sel,0,0);
$sid=create_sid();
$ip=get_ip();
$t3=time();
$res2=mysql_query ("insert into sessions (uid,sid,ip,lastaction) values ($uid,'$sid','$ip',$t3)");
$res3=mysql_query ("delete from sessions where lastaction<$t3-7200 or closed=1");
}
return $sid;
}
function logout($sid)
{
$tim=time();
$res=mysql_query ("update sessions set lastaction=$tim, closed=1 where sid='$sid'");
}
function get_uid($sid)
{
$ip=get_ip();
$t=time();
$res=mysql_query ("select uid from sessions where closed='0' and sid='$sid' and ip='$ip' and lastaction+7200>$t") or die(mysql_error());
$n=mysql_num_rows ($res);
if ($n==0) $uid=-1;
else
{
$uid=mysql_result($res,0,0);
$t2=time();
$res2=mysql_query ("update sessions set lastaction=$t2 where sid='$sid'");
}
return $uid;
}
?>
Fatal error: Call to undefined function get_uid() in /www/www.buybuy.dolphinet.hu/index.php on line 43