Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Check your phpinfo() to make sure the session module is enabled, too.

  • #4
    New Coder
    Join Date
    Nov 2007
    Posts
    12
    Thanks
    0
    Thanked 1 Time in 1 Post
    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]
    Last edited by phpBuddy; 11-29-2007 at 03:51 AM.
    echo "PHP 5.2.5";
    exit ( "Script End" );

  • #5
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    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:
    Warning: session_start() has been disabled for security reasons
    That's interesting though; I would have thought it would cause a fatal error.

  • #6
    New Coder
    Join Date
    Nov 2007
    Posts
    12
    Thanks
    0
    Thanked 1 Time in 1 Post
    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" );

  • #7
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,024
    Thanks
    2
    Thanked 314 Times in 306 Posts
    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.
    Last edited by CFMaBiSmAd; 11-29-2007 at 09:11 AM.
    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.

  • #8
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •