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

    Share
    avatar
    KillinSprE

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

    Turning main.php into a function

    Post  KillinSprE on 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?
    avatar
    KillinSprE

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

    Re: Turning main.php into a function

    Post  KillinSprE on 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 Mon Nov 20, 2017 9:36 am