In my php file error will display as Undefine function session_is_register [duplicate]

放肆的年华 提交于 2019-12-25 07:49:47

问题


How to correct the programme

Error will display Call to undefined function session_is_registered() in /home/rajesh/public_html/lib/common.php on line 40 this is the 40th line

if(!session_is_registered("u_type")) {
    session_register("u_type");
}
if(trim($_REQUEST['u_type']) != "") {
    $_SESSION['u_type'] = trim($_REQUEST['u_type']);
}

another error configures.php am upload the file in my domain

mysql_connect(): Access denied for user 'rajesh'@'localhost' (using password: YES) in /home/rajesh/public_html/lib/configures.php on line 4

<?php
require_once "config.php";
require_once "var.inc.php";
$connect = mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD);
$link = mysql_select_db(DB_NAME, $connect);


$sql = "SELECT * FROM ".CONFIG_TABLE."";
$res = mysql_query($sql);
$row = mysql_fetch_array($res);

Any one help me to correct the file and send a mail id am contact


回答1:


session_is_registered() was deprected on PHP 5.3.0 and removed on PHP 5.4.0 so I would bet that you are running PHP 5.4.0

You can easilly find out what version of PHP by calling phpinfo();

Regarding the MySQL issue... you most probably have a user permission issue: Check:

  • That the mysql username has access from that computer. If MySQL is running on the same machine as the PHP server, you must have the DB_USER name that you are using with @localhost. In MySQL a user with username@% wildcard does not include localhost.

  • Make sure that the mysql user actually has been granted access to the DB. And again, username@localhost is different than username@%.



来源:https://stackoverflow.com/questions/29931889/in-my-php-file-error-will-display-as-undefine-function-session-is-register

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!