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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:03:29+00:00 2026-05-16T17:03:29+00:00

Recently I created a script that accesses another script to run it. The only

  • 0

Recently I created a script that accesses another script to run it. The only way the second script will run, is if it is accessed from the same server. To accomplish this I’ve made a simple if ($_SERVER['REMOTE_ADDR'] == "XXX.XXX.XXX.XXX") {

(Obviously the XXX.XXX.XXX.XXX is replaced with my server’s IP.)

However, I’d like the script to be more portable, so I want it to somehow detect the IP of the same server or something.

Suggestions? Or is this even possible?

  • 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-16T17:03:30+00:00Added an answer on May 16, 2026 at 5:03 pm

    To answer your question $_SERVER['SERVER_ADDR'] will return the IP Address of the server where the current script is executing, but yeah there’s better ways to do this, such as making the script unable to be accessed from the web in the first place.

    http://php.net/manual/en/reserved.variables.server.php

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

Sidebar

Ask A Question

Stats

  • Questions 536k
  • Answers 536k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer WCF is hosted by IIS, and thus subject to its… May 17, 2026 at 1:32 am
  • Editorial Team
    Editorial Team added an answer var myDate = new Date( parseInt(YYYY,10), parseInt(MM,10)-1, parseInt(DD,10) ); note… May 17, 2026 at 1:32 am
  • Editorial Team
    Editorial Team added an answer You'd have to approach this completely differently. You'd either have… May 17, 2026 at 1:32 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am trying to have an automated script that enters into the most recently
I've recently needed to write a script that performs an os.fork() to split into
G'day, We have a Perl script that is processing geolocation requests from the head-end
I need to create an ImageIcon from an image on a remote server. When
I'm struggling with a Mac OS X 10.5.8 that I've started using recently for
I have developed a recursive FTP-download script, in PHP5, that allows you to select
I've created an OS X installer package that includes localized resources (License.html, Readme.html, etc.)
I recently created an MVC2 application. I am having trouble bringing it up on
I created a calendar with Datepicker, but recently I'm having some trouble with it.
I have recently started working on a legacy application that has most of its

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.