...

View Full Version : Fatal error: Call to undefined function session_start



mhauth
11-29-2007, 01:02 AM
Fatal error: Call to undefined function session_start() in /home/.rao**/evol****/tube.evolutionofgolf.com/siteadmin/login.php on line 6


<?php
include ("../include/config.php");
STemplate::assign('url', $config[baseurl]);
//PROCESS LOGIN
if ($_POST['login'] != "")
{
if ($_POST['uname'] == "" or $_POST['pass'] == "")
$err = "Please Provide Username and Password.";
elseif ($_POST['uname'] != $config['admin_name'] and $_POST['pass'] != $config['admin_pass'])
$err = "Invalid Username and/or Password Provided";
elseif ($_POST['uname'] == $config['admin_name'] and $_POST['pass'] == $config['admin_pass'])
{
//REGISTER SESSION
session_register("AUID");
session_register("APASSWORD");
$_SESSION['AUID'] = $config[admin_name];
$_SESSION['APASSWORD'] = $config[admin_pass];
$link = "main.php?active=Users";
header("Location: $link");
}
else
$err = "Invalid Username/Password. Login failed.";
}
STemplate::assign('msg', $msg);
STemplate::assign('err', $err);
STemplate::display('siteadmin/login.tpl');
?>


Thank in advance. I really do appreciate it.

Matt

_Aerospace_Eng_
11-29-2007, 01:16 AM
Post the code for config.php.

Be sure to remove any database passwords and usernames.

Inigoesdr
11-29-2007, 03:23 AM
Check your phpinfo() (http://php.net/phpinfo) to make sure the session module is enabled, too.

phpBuddy
11-29-2007, 03:39 AM
Check your phpinfo() (http://php.net/phpinfo) to make sure the session module is enabled, too.
I wonder if a function is disabled (by host PHPconfiguration), will this also give error:
Fatal error: Call to undefined function
... or maybe this gives another Error message?

You should, as told, run phpinfo();
and look for session module and also see if any functions are disabled

Function below will show all extensions, including session module, if is loaded:
and the second will check if function exists.
But all this info you will get from phpinfo() as well.

<?php

echo '<pre>'.print_r( get_loaded_extensions(), true).'</pre>';

if ( function_exists( 'session_start' ))
echo 'YES session_start exists';
else
echo 'NO session_start function';

?>[/b]

Inigoesdr
11-29-2007, 04:40 AM
I wonder if a function is disabled (by host PHPconfiguration), will this also give error:
Fatal error: Call to undefined function
... or maybe this gives another Error message?
I just tested it, and it gives an error like this:

Warning: session_start() has been disabled for security reasons
That's interesting though; I would have thought it would cause a fatal error.

phpBuddy
11-29-2007, 06:54 AM
Warning: session_start() has been disabled for security reasons

What a bad php hosting!
Disabled sessions!
It is the first time I have ever heard such stupid ....
PHP becomes almost useless for most standard applications

CFMaBiSmAd
11-29-2007, 09:08 AM
Since the OP has not posted back any additional information, don't jump to conclusions.

Either his php was built without support for sessions (perhaps this is his own Unix based server and when he built php he did not include the configuration line to include session support) or he is on a web host that has disabled the session_start() function in php.ini (which would be a bad host because there is no practical reason to do this.)

In fact the disabled message that Inigoesdr got is different than the message in the first post, so it is more likely that his php was built without session support.

aedrin
11-29-2007, 03:25 PM
What a bad php hosting!
Disabled sessions!
It is the first time I have ever heard such stupid ....
PHP becomes almost useless for most standard applications

The user tested it out, I doubt that was from an actual host.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum