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

  • Home
  • SEARCH
  • 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 4068968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:26:28+00:00 2026-05-20T16:26:28+00:00

Here is the include file called ‘VariablesFunctions.php’: $currWebPage = ”; function getPageUrl( ) {

  • 0

Here is the include file called ‘VariablesFunctions.php’:

$currWebPage = '';
function getPageUrl( )
{
    global $currWebPage; 
    if( $_SERVER['HTTPS'] == 'on' ) $currWebPage .= 's';
    $currWebPage .= '://';
    if( $_SERVER["SERVER_PORT"] != "80" )
        $currWebPage .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    else $currWebPage .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}  

here is the file (index.php) which calls it:

<?php include( 'VariablesFunctions.php' );
      getPageUrl( );
  echo $currWebPage;
?>

both files are saved in same directory, and when launching the index.php file the browser says undefined function (line 2 above in index.php file), why?

  • 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-20T16:26:29+00:00Added an answer on May 20, 2026 at 4:26 pm

    This sometimes means another include file with the same name (old or backup version) exists elsewhere in the include_path. To avoid that, use an explicit path and force it to fail reliably:

    <?php require('./VariablesFunctions.php');
        getPageUrl();
    

    The issue might also be caused by your mixed-case filenames. On BSD/Linux servers the filenames must match exactly, they are not considered case-insensitive.

    Also: avoid returning results via a global variable, make it a proper return value.

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

Sidebar

Related Questions

I use a parser generator here, that unfortunately insists on putting a #include <some/file.h>
Here's the code. Not much to it. <?php include("Spreadsheet/Excel/Writer.php"); $xls = new Spreadsheet_Excel_Writer(); $sheet
I have this file 'gardens.php' , which pulls data from a table called 'generalinfo'
I have a global.php file that I call from the top of every script.
I have a program here: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/ipc.h> #include
Here is a little test program: #include <iostream> class Test { public: static void
Here's the problem, you include multiple assemblies and add 'using namespaceX' at the top
Okay here's the program I have typed up(stdio.h is included also): /* function main
I'm working on a site here where I include parts of the site that
I have a structure defined in a header file called data.h. I am including

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.