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 8588577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:50:13+00:00 2026-06-11T22:50:13+00:00

I am call a function which is defined in my smsconfig.php file like $GLOBAL_URL_OF_THE_SITE=

  • 0

I am call a function which is defined in my smsconfig.php file like

$GLOBAL_URL_OF_THE_SITE= "http://webfaction";


function get_site_url(){
    return $GLOBAL_URL_OF_THE_SITE; 
}

In my index.php file, I am including that smsconfig.php file then I am doing the following:

  <?php 
    include("smsconfig.php");
    ?>
    <html>
    <head >
     <link rel="stylesheet" type="text/css" href="default.css" />
        <script src="<?php echo get_site_url();?>/UI/jquery/jquery-1.7.2.min.js" type="text/javascript"></script>

unfortunately my JS is not loading and I am getting the following error in firebug:

"NetworkError: 404 Not Found - http://webfaction/UI/%3Cbr%20/%3E%3Cb%3ENotice%3C/b%3E:%20%20Undefined%20variable:%20GLOBAL_URL_OF_THE_SITE%20in%20%3Cb%3E/opt/lampp/htdocs/UI/smsconfig.php%3C/b%3E%20on%20line%20%3Cb%3E11%3C/b%3E%3Cbr%20/%3E/UI/jquery/jquery-1.7.2.min.js"

Please tell me what I am doing wrong ?

  • 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-06-11T22:50:14+00:00Added an answer on June 11, 2026 at 10:50 pm

    Functions do not have access to global variables by default. You have to declare the variable with global before accessing it:

    $GLOBAL_URL_OF_THE_SITE= "http://webfaction";
    
    function get_site_url(){
        global $GLOBAL_URL_OF_THE_SITE;
    
        return $GLOBAL_URL_OF_THE_SITE; 
    }
    

    Without global, you should be seeing a warning, which you may be suppressing:

    PHP Notice: Undefined variable: GLOBAL_URL_OF_THE_SITE

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

Sidebar

Related Questions

i am trying to call a function which is defined in another js file
I have a C program which has a function call that is defined in
I want to call a function which is in another php class that I
Hi guys i am trying to call a function which is defined in main.mxml
I have a function defined which includes a return statement but no value is
My php function does not recognize a variable defined in another php file that
I try to call a function which checks a rule and if the rule
How to call a function which takes two parameters using threading in C#? I
I try to call a function which passed as function pointer with no argument,
In my Application I need to call a function(Which update the valuesof textviews),I need

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.