vitalka12
Новичок
Catchable fatal error
Что за ошибка
Catchable fatal error: Object of class login could not be converted to string in /home/hdd1.ru/mysms/sites/www/includes/function.php on line 23
Что за ошибка
Catchable fatal error: Object of class login could not be converted to string in /home/hdd1.ru/mysms/sites/www/includes/function.php on line 23
PHP:
function generate_password($number){
$arr = array('a','b','c','d','e','f',
'g','h','i','j','k','l',
'm','n','o','p','r','s',
't','u','v','x','y','z',
'A','B','C','D','E','F',
'G','H','I','J','K','L',
'M','N','O','P','R','S',
'T','U','V','X','Y','Z',
'1','2','3','4','5','6',
'7','8','9','0','.',',',
'(',')','[',']','!','?');
$pass = "";
for($i = 0; $i < $number; $i++){
$index = rand(0, count($arr) - 1);
$pass .= $arr[$index];}
return $pass;}
class login{
function check(){
if(mysql_num_rows(mysql_query("SELECT login, password FROM users WHERE login='".$_SESSION['login']."' and password='".$_SESSION['pwd']."'")) == 1) {
$output = true;
}else{
$output = false;
}
return $output;}
function info($key){
$profile = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE login='".$_SESSION['login']."' and password='".$_SESSION['pwd']."'"));
return $profile[$key];}
}