PHP Login System with Admin Features

Would you like to react to this message? Create an account in a few clicks or log in to continue.
PHP Login System with Admin Features

This forum was created to talk about the PHP Login System with admin features created by jpmaster77 on evolt's website


    Turning main.php into a function

    KillinSprE
    KillinSprE


    Number of posts : 2
    Registration date : 2013-09-23

    Turning main.php into a function Empty Turning main.php into a function

    Post  KillinSprE Mon Sep 23, 2013 6:32 pm

    The script works well when ran on its own. But I have been trying to simply copy and paste the entire main.php into my own php file as a function to be called from my main. When I test this function I get "Fatal error: Call to a member function addActiveGuest() on a non-object in C:\wamp\www\include\classes\session.php on line 60". Any idea why?
    KillinSprE
    KillinSprE


    Number of posts : 2
    Registration date : 2013-09-23

    Turning main.php into a function Empty Re: Turning main.php into a function

    Post  KillinSprE Tue Sep 24, 2013 1:04 pm

    Maybe I wasn't clear enough. With the database installed and all scripts unmodified it works great. But if I try to turn main.php into a function with

    Code:

    <?php

    function login() {

         // main.php in its entirety unmodified

         }

    login()
    and run this script I get an "Call to a member function addActiveGuest() on a non-object in C:\wamp\www\include\classes\session.php on line 60" error. I'm baffled as to why. Please help.

      Current date/time is Fri May 17, 2024 4:58 am