Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-29-2007, 01:02 AM   PM User | #1
mhauth
New Coder

 
Join Date: Aug 2006
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
mhauth is an unknown quantity at this point
Fatal error: Call to undefined function session_start

Fatal error: Call to undefined function session_start() in /home/.rao**/evol****/tube.evolutionofgolf.com/siteadmin/login.php on line 6

PHP Code:
<?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
mhauth is offline   Reply With Quote
Old 11-29-2007, 01:16 AM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Post the code for config.php.

Be sure to remove any database passwords and usernames.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 11-29-2007, 03:23 AM   PM User | #3
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Check your phpinfo() to make sure the session module is enabled, too.
Inigoesdr is offline   Reply With Quote
Old 11-29-2007, 03:39 AM   PM User | #4
phpBuddy
New Coder

 
Join Date: Nov 2007
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
phpBuddy is an unknown quantity at this point
Quote:
Originally Posted by Inigoesdr View Post
Check your 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 Code:
<?php

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

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

?>[/b]
__________________
echo "PHP 5.2.5";
exit ( "Script End" );

Last edited by phpBuddy; 11-29-2007 at 03:51 AM..
phpBuddy is offline   Reply With Quote
Old 11-29-2007, 04:40 AM   PM User | #5
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Quote:
Originally Posted by phpBuddy View Post
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:
Quote:
Warning: session_start() has been disabled for security reasons
That's interesting though; I would have thought it would cause a fatal error.
Inigoesdr is offline   Reply With Quote
Old 11-29-2007, 06:54 AM   PM User | #6
phpBuddy
New Coder

 
Join Date: Nov 2007
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
phpBuddy is an unknown quantity at this point
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
__________________
echo "PHP 5.2.5";
exit ( "Script End" );
phpBuddy is offline   Reply With Quote
Old 11-29-2007, 09:08 AM   PM User | #7
CFMaBiSmAd
Senior Coder

 
CFMaBiSmAd's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado USA
Posts: 2,712
Thanks: 2
Thanked 251 Times in 243 Posts
CFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the rough
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.
__________________
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

Last edited by CFMaBiSmAd; 11-29-2007 at 09:11 AM..
CFMaBiSmAd is offline   Reply With Quote
Old 11-29-2007, 03:25 PM   PM User | #8
aedrin
Senior Coder

 
Join Date: Jan 2007
Posts: 1,648
Thanks: 1
Thanked 58 Times in 54 Posts
aedrin will become famous soon enough
Quote:
Originally Posted by phpBuddy View Post
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.
aedrin is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:00 AM.


Advertisement
Log in to turn off these ads.