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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:02:28+00:00 2026-05-28T01:02:28+00:00

I have 2 separate servers (Server A and Server B) each with a PHP

  • 0

I have 2 separate servers (Server A and Server B) each with a PHP script (Script 1 and Script 2).

I have PHP script 2 on Server B that I want to run, but only from PHP script 1 on Server A. I do not want any other http requests to pass through the directory on Server B where my protected script resides.

In other words –> run script 2 on Server B only if http request comes from script 1 on Server A. {Note: I do not want to button-down by IP, only by referring script]

Is this doable in an .htaccess file using Allows and Denys? Or is it done some other way.

I can’t do this via a _SERVER var because I can’t seem to capture the referring script in my PHP Script 2.

Thanks.

  • 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-28T01:02:29+00:00Added an answer on May 28, 2026 at 1:02 am

    You can deny access to all IPs except Server A (with the ip = 888.888.888.888) on server B by adding this to the .htaccess in the root of your script:

    order deny,allow
    deny from all
    allow from 888.888.888.888
    

    But it depends how the script on Server B is accessed by Server A – if it’s a server side call it should work.
    I would also suggest using a token system:
    Server A sends a request and a token to server B (something like md5(a secret string + request data))
    Server B checks token and and runs the script if everything checks out.

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

Sidebar

Related Questions

edit: SQL Server 2005 I have a customer application running on 5 separate servers.
I'm struggling to design the server-side script that responds to requests from an Ajax
I'm writing a simple php/mysql script that gets all ads I have in my
I have 2 separate pages, each opens a web socket to the server, one
I have two separate files that one is server-side JS. The other one is
I have a php script that generates php and javascript wrapper classes that handle
We have our JBoss and Oracle on separate servers. The connections seem to be
We have a remoting singleton server running in a separate windows service (let's call
I have a virtual machine running windows 2003 server. It is on a separate
I have 2 separate java services that use a complex type that is a

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.