Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7441781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:04:19+00:00 2026-05-29T11:04:19+00:00

Recently downloaded some code for a minor open-source project related to a small webgame

  • 0

Recently downloaded some code for a minor open-source project related to a small webgame I play. Trying to access it fails and spits out an error message of:

PHP Fatal error: Call to undefined function v() in /Applications/MAMP/htdocs/infocenter/modules/security_mod.php on line 7

After searching, I found that the function v() is defined in a file called “system.php” which is required by a file which is required by a file which is required by the “security_mod.php” file that the error occurs in. No errors occur with any of the require calls (and they’re all ‘require_once’, not an ‘include’).

This is the whole of the system.php file:

<?php
function v($a, $i)
{
    return isset($a[$i]) ? $a[$i] : null;
}
?>

This is the function in ‘security_mod.php’ that throws the error (also including the require calls):

<?php
require_once("settings_mod.php");
require_once("account_mod.php");//this file requires base_mod.php, which requires system.php

class SecurityMod {
    public static function checkLogin() {
        $name = v($_REQUEST, "acc");//this is the line that causes the error
        $password = v($_REQUEST, "pwd");
        if (!isset($name) || !isset($password)) {
            return null;
        }
        $acc = AccountMod::getAccount($name);
        if (SettingsMod::USE_ENCRYPTED_PASSWORDS) {
            if (is_null($acc) || $acc->getPassword() != md5($password)) {
                return null;
            } else
                return $acc;
        } else {
            if (is_null($acc) || $acc->getPassword() != $password) {
                return null;
            } else
                return $acc;
        }
    }
?>

I did a little testing, and found out that I can access variables and functions in some of the other required files. All of those are in classes, though, unlike v(). Would that be the reason?

EDIT to clarify how ‘system.php’ is required:
‘security_mod.php’ has these two require_once calls at the beginning of the file:

require_once("settings_mod.php");
require_once("account_mod.php");

‘settings_mod.php’ is a file containing constants used through the program, and includes no files.
‘account_mod.php’ has these two require_once calls:

require_once("base_mod.php");
require_once("account.php");

‘account.php’ has a pair of include_once calls that include inconsequential and unrelated files.
‘base_mod.php’ is the file with the ultimate requirement for ‘system.php’:

require_once("system.php");
require_once("settings_mod.php");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:04:19+00:00Added an answer on May 29, 2026 at 11:04 am

    Found the issue: the System.php file being successfully included wasn’t the same as the one in the downloaded code. Since base_mod.php only provided a filename, not a path, PHP first checked in the directory specified by my include_path, which turns out to contain a file named System.php. Since my filesystem is case-insensitive, that was judged to be the same as system.php, and therefore got included instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

recently I downloaded this open source project and I am trying to compile it.
I recently downloaded ndepend and ran an analysis on an open source project I
I downloaded the qt embedded demo source code recently on my linux machine. Following
I downloaded Flash Builder from here : Download I recently started writing some small
I recently downloaded Visual Studio 2010b2, and wanted to re-evaluate some of my questions
I recently downloaded the source tarball for a GTK application that I'd like to
I recently downloaded PLT Scheme and DrScheme. When I open DrScheme, I am told
I recently downloaded the latest NetBeans IDE (for MACOSX) and imported/migrated a project over
I recently downloaded linux source from http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.34.1.tar.bz2 . I came across the below paragraph
Recently, I was trying to prototype some jQuery-based menu into ASP.NET MVC. Just to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.