UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  eUKhost's Official Web Hosting Forum > Web Hosting and Domains > PHP Hosting

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 10-11-2009, 11:14
Member
 
Join Date: Oct 2009
Posts: 45
Question Get domain of the site that sent an http request

i have a script on one of my sites that is accessible to 2 other sites and only those 2 sites.

i have a relatively simple script to block access to other users whereby the ip address MUST match that of the websites who have permission to access. i know it's not perfect (i.e. any other sites on the same shared server could, if they wanted to, access the script*) but it will suffice.

i also have it set up that any attempts that don't match my criteria sends me an email with the date, time and the ip of the source of the request. however the ip address isn't actually that useful in determining who, or which site, was attempting to access the script. the normal method of $_SERVER[SERVER_NAME] (or SERVER_ADDR) just gives me my domain etc as this is where the script is running.

REMOTE_ADDR gives me the ip address of the breach but isn't that useful.

HTTP_REFERER is blank so of no use.

so, does anyone have any other ideas as to how i can get this information?!

MaFt


* before those who remember the recent sheffield server shenanigans, don't worry - the script simply outputs an xml feed and won't change all your index*.* files!
__________________
http://maft.co.uk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 16-11-2009, 09:12
Member
 
Join Date: Oct 2009
Posts: 45
Default

nobody any ideas?!
__________________
http://maft.co.uk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 28-11-2009, 03:45
Rock's Avatar
System Administrator (eUKhost.com)
 
Join Date: Dec 2006
Location: localhost
Posts: 2,484
Send a message via MSN to Rock
Smile

Quote:
Originally Posted by MaFtuk View Post
nobody any ideas?!
Hi,

To restrict access to a particular file within a directory, use this in the .htaccess:

Any of the above techniques can be applied to a single file within the host directory instead of the directory as a whole.

<Files script.php>
order deny,allow
deny from all
allow from domain1.com
allow from domain2.com
allow from xx.xx.xx.xx
allow from yy.yy.yy.yy

</Files>


The above code will allow access only to the specified allow from hosts, to the file script.php. Additional file names can be specified, separated by commas; alternatively wildcards can be used to specify multiple files, eg: <Files *> would affect all the files in the directory.

You can download Page Guard Pro if you want to log all events containing authorized & unauthorized logins by IP Address, requested URI & along with more information.. from a web browser interface
__________________

Rock _a.k.a._ Jack L.
Windows Hosting || Windows Reseller Hosting
Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
Follow eUKhost on Twitter || Join eUKhost Community on Facebook
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 30-11-2009, 12:18
Member
 
Join Date: Oct 2009
Posts: 45
Default

thanks for that. is there a way to only allow certain 'browsers'? eg to check for a string in teh browser header?

MaFt
__________________
http://maft.co.uk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT. The time now is 14:35.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
UK Web Hosting by eUKHosting 3.1.0
Copyright © 2001-2010, eUKhost LTD. All rights reserved.

 
 
UK VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

VoIP Dedicated Servers
Asterisk, Trixbox Dedicated Servers

Business Web Hosting
100% uptime Hosting

UK Cpanel Hosting
cPanel Shared Hosting

Domain Hosting
Cheap Domains & Hosting Plans

UK Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

ColdFusion Hosting
ColdFusion Web Hosting


 
Reseller Web Hosting UK
 
knowledgebase articles
eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting

Joomla Hosting
Joomla Web Hosting

Mambo Hosting
Mambo Web Hosting

Magento Hosting
Magento Web Hosting

Wordpress Hosting
Wordpress Web Hosting


popular blog categories

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles