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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:04:40+00:00 2026-05-27T10:04:40+00:00

Can I get information from which web site is came request to read XML

  • 0

Can I get information from which web site is came request to read XML file on my web server, and insert into database this information from request?

For example, I want to develop a some script and when client install my script on his server, every time when he go to his website he call simplexml_load_file to get information if there new version of script and how to update it. I would like to know who has my script.


“blind” I try to make with .htaccess but it didn’t work anything 🙁 when I call text.php:

<?php
$myFile = "save.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = $_SERVER['REMOTE_ADDR']." : ".$_SERVER['REQUEST_TIME']."\n";

fwrite($fh, $stringData);
fclose($fh);

 $xml = file_get_contents('test.xml');
    header("Content-Type:text/xml");  
    echo $xml;
?>

he put me on save.txt file information from which IP address call is coming. Can I know from which web address is call is coming?
And how to fix to call XML file instead php file?

  • 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-27T10:04:40+00:00Added an answer on May 27, 2026 at 10:04 am

    maybe you want to try using super global $_SERVER[‘HTTP_REFERER’]. Try echoing it to see what it contains, and you will get how it works. Put a link to this script on a forum or a different domain and click to see the results.

    And to know exactly who have your script, you can make them register (in order to get their name), or save the domains in a database to view later as logs (and maybe fill in manually the details about that specific domain), etc, etc.

    EDIT:

    I see that you have an XML file. Well you should work with htaccess and handle that request with a different script, and in that script use $_SERVER[‘HTTP_REFERER’].

    OR: make it be a php file that will be requested. And do all the stuff to save what information you need, like the referer domain, and at the end of the file read with what ever you want (fread, file_get_contents, file, etc) the real xml file and output it… if you have problems with it, try setting the header first using header(): http://www.php.net/manual/en/function.header.php , to make it look (and feel) like a true xml file. I thing the correct header would be text/xml, or better: application/rss+xml.

    <?php
        file_put_contents('save.txt', $_SERVER['HTTP_REFERER'].PHP_EOL);
        $xml = file_get_contents('test.xml');
        header('application/rss+xml');
        echo $xml;
    ?>
    

    save the file as test.php

    then make another file someonewhousethescript.html, put it in the same folder, put in it a link to test.php (after you do the thing with .htaccess you should link directly to test.xml).

    and go to mrakodol.info/someonewhousethescript.html and click the link

    and look into save.txt. There you will most probably see mrakodol.info/someonewhousethescript.html this is what I think you wanted.

    And if you really want to keep the extension to .xml, you can always use apache mod-rewrite. If it is necessary I will provide a sample.

    As for the extension, then make a new file in that folder (the root folder of the website as it seems) and name it .htaccess, and in it write the following lines:

    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^GET$ [NC]
    RewriteRule test.xml test.php [NC]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can you get the version information from a .dll or .exe file in
I'm building a web form in which administrators on my site can add XML
In SQL you can use SELECT * FROM INFORMATION_SCHEMA.TABLES etc to get information about
In ASP.NET MVC, I can get information on unit testing for routes and custom
I'm detecting the insertion of memory cards (removable media). Can I get information about
How can I get the timezone information for a country?
following the wealth of information found here how can we get an external .config
I'd be much obliged for information regarding how can I get the System Identification
I can get easily see what projects and dlls a single project references from
I can get both System.Net.Mail and System.Web.Mail to work with GMail, but I can't

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.