Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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.</p> <p>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. </p> <p>EDIT:</p> <p>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'].</p> <p>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(): <a href="http://www.php.net/manual/en/function.header.php" rel="nofollow">http://www.php.net/manual/en/function.header.php</a> , 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. </p> <pre><code>&lt;?php file_put_contents('save.txt', $_SERVER['HTTP_REFERER'].PHP_EOL); $xml = file_get_contents('test.xml'); header('application/rss+xml'); echo $xml; ?&gt; </code></pre> <p>save the file as test.php</p> <p>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).</p> <p>and go to mrakodol.info/someonewhousethescript.html and click the link</p> <p>and look into save.txt. There you will most probably see mrakodol.info/someonewhousethescript.html this is what I think you wanted.</p> <p>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.</p> <p>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:</p> <pre><code>RewriteEngine on RewriteCond %{REQUEST_METHOD} ^GET$ [NC] RewriteRule test.xml test.php [NC] </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload