-
Detect User or Redirect Page
I have 2 seperate websites that deals with entirely different subjects. I maintain a database of users who visit my websites. Yesterday as i was going through the user records I noticed someone has been frequently visiting both my websites for the past 2 years(its always the same IP address), and that too from a place that has no relevance to my target audience(country/language).
IP: 183.97.XXX.XXX
Browser Info: Firefox/7.0.1
Javascript: Never enabled(for the past 2 yrs)
Strangely, this user has been visiting only the "homepage" of both my sites.
Is there any way I can find out who this user is? Or atleast I should be able to redirect my home page to "Sorry page not available for this country" to this user IP alone" ? I want the php to do this redirect(or something similar to that). May be I can load this php file through <iframe> inside my homepage.html?
Any ideas?
-
Hi,
first of all, whois with the ip points at Korea.
If your sites are alredy php, it would make sense to to add a stanza like
Code:
<? if($_SERVER['REMOTE_ADDR'] == '183.97.1.1') { ?>
... your alternate content goes here ...
<? }
exit;
?>
You say that this "visitor" does not even look at the images, stylesheets etc. on your site?
If you still see these visits after you have told the visitor to go, you can be assured that the "browser" is some kind of automated system
Musicman
-
thanks for your reponse
Thats right this visitor doesn't seem to visit any other pages except my homepage.
Is there a way I can show an "alternative content" to this user without displaying the actual content in my HTML homepage?
Currently I am not using php the way you have used. My homepage is an html file that has an <iframe> at the bottom of the page, which loads a php file that can detect Users IP (and pushes it into the database). So I was thinking about inserting a similar <iframe> (if possible) which loads a php script. The script should be able to redirect this particular visitor to some other page, if not atleast be able to display an alternative content in place of my actual homepage content).
-
Hi,
unless there are too many links back to index.html inside your web content, I would probably just rename the index.html to index.php and put the code there.
You probably could put stuff into an iframe, but would the "visitor" ever really view that?
-
I am afraid I cant do that because my "homepage.html" has links to all other sections in my website. The website has a seperate Welcome page called "index.html" that has only a 2-line text. I dont have a problem renaming it, but thats not required.
-
Hi,
would you mind to post your website address
Musicman
-
Sorry. Its a private community website.
I would like to know - is it possible(using php script loaded into an iframe) to display alternative content instead of the actual HTML content? If thats not possible then is it possible to redirect this user to some other page using PHP (within my html)
-
and it just got creepy!... Bye Bye Blitz....
Defy the boundaries!.. NEVER surrender to the code!!!.....
-
lol, bye back2012
Anyone there? Is it possible to do this?
-
-
Hi,
the only thing I could suggest without actually seeing your site is a bit of server trickery: if the site is running on an Apache webserver, and you are allowed to use mod_rewrite, you could arrange for calls to something.html being redirected to something.php
Musicman
-
thanks mate
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|