I know that php is getting very old but it is the only coding that i partially know that is easy enough to use for a registration and login system. If more coding or information is needed then please ask before marking as a non-question.
I keep receiving the error below. My init.php and config.php are included. mysql info has been changed for the protection of my website.
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home/a5236314/public_html/ooplr/core/init.php on line 20
init.php
<?php
session_start();
$GLOBALS['config'] = array(
'mysql' => array(
'host' => '127.0.0.1',
'username' => 'root',
'password' => '',
'db' => 'lr'
),
'remember' => array(
'cookie_name' => 'hash',
'cookie_expiry' => 604800
),
'session' => array(
'session_name' => 'user'
)
);
spl_autoload_register(function($class){ // 'This is line 20'
require_once 'classes/' . $class . '.php';
});
require_once 'functions/sanitize.php';
config.php
<?php
class Config{
public static function get($path = null) {
if($path) {
$config = $GLOBALS['config'];
$path = explode('/', $path);
print_r($path);
}
}
}