I get many error and the site not work after update the php version.
[Wed Sep 10 21:47:14.094755 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Notice: Undefined variable: text in /home/**/inc/function.php on line 81
[Wed Sep 10 21:47:14.094785 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Notice: Undefined variable: text in /home/**/inc/function.php on line 81
[Wed Sep 10 21:47:14.094794 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Notice: Undefined offset: 3 in /home/**/inc/function.php on line 81
[Wed Sep 10 21:47:14.094814 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Notice: Undefined variable: text in /home/**/inc/function.php on line 81
[Wed Sep 10 21:47:14.094822 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Notice: Undefined offset: 3 in /home/**/inc/function.php on line 81
[Wed Sep 10 21:47:14.094842 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Notice: Undefined variable: text in /home/**/inc/function.php on line 81
[Wed Sep 10 21:47:14.094849 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Notice: Undefined offset: 3 in /home/**/inc/function.php on line 81
[Wed Sep 10 21:47:14.094869 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Notice: Undefined variable: text in /home/**/inc/function.php on line 81
[Wed Sep 10 21:47:14.094876 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Notice: Undefined offset: 3 in /home/**/inc/function.php on line 81
[Wed Sep 10 21:47:14.094902 2014] [:error] [pid 21347] [client 5.28.155.234:59471] PHP Fatal error: Call to undefined function session_register() in /home/**/inc/config.php on line 58
the code is:
line 81:
{
$text.=$e[$i]." ";
}
config file line 58:
session_register("views");
There is all you need in your error messages:
variable: text in /home/**/inc/function.php on line 81
this means that the vairalbe $text
isn't set before. So define the variable before.
The second is that session_register()
isn't supported anymore. So replace it.
$_SESSION['views'] = 'test';
You had that errors before but you had disabled your Notices.
Isn't this set inside an if?
{
$text.=$e[$i]." ";
}
If it is, and the case will be false, then this variable will not be set at all. You can bypass this message by declaring it like $text = '';
at the beginning of your script for example. This might not be the best practice, but it will get rid of the message.
Undefined offset refers to - what is really hard to determine without more code - that there is no such thing as $e[3]
. Is it in a for loop? If so, it might be the issue, that you are using $i <= something
instead of $i < something
Also, session_register is used only < PHP 5.4.0.
You can do this for example
$_SESSION['username'] = $username;
Before using $text.=$e[$i]." ";
you have to define the $text
. For example like $text ="";
or $text =[];
etc.