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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:39:17+00:00 2026-06-07T08:39:17+00:00

I have a script that makes a POST request to my website from other

  • 0

I have a script that makes a POST request to my website from other websites (different domains) and I need to know if it’s possible to get what’s that other domain.

Like: helloworld.com uses my script and it executes a POST request with mywebsite.com. How does mywebsite.com know that the request is from helloworld.com?

I have tried with $_SERVER['REMOTE_HOST'] but that’s not working.

  • 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-07T08:39:19+00:00Added an answer on June 7, 2026 at 8:39 am

    You need to inspect the HTTP referrer.

    In PHP this would be $_SERVER['HTTP_REFERER'];.

    In JavaScript, this would be document.referrer.

    Note that it can be inaccurate and is easy to be spoofed, so it’s value should be taken with a pinch of salt.


    To provide a little bit more detail on how you can do this reliably (albeit with the cooperation of the remote server):

    1. Let secret be a arbitrary string (abc123).
    2. Let key be a random string which is unique to each request (e.g. the current time)
    3. Generate token by md5(secret + key).
    4. Have the remote server include key and token (but not secret) in the POST request.
    5. On your server, ensure that md5(secret + key) === token

    Because no-one knows the secret, you can guarantee that the request originated from the remote server. Of course, it’s then possible for someone to request the form from the remote server, steal the key and token, and then forward the request to yourself…

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

Sidebar

Related Questions

I have a form that makes an Ajax POST request to insert a widget
I have a script that makes use of a package (PKG_MY_PACKAGE). I will change
I have a Python script that makes use of 'Print' for printing to stdout.
With my database upgrade scripts, I typically just have one long script that makes
I have to write a bash script that makes lot of things. I'd like
I have a python script that uses threads and makes lots of HTTP requests.
I have a python function that makes a subprocess call to a shell script
I have a page that is making an XML POST-Request to an URL on
My situation is that I have a POST cgi script that generates and returns
I have a tested and working php script that pulls from a db and

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.