A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Detect User or Redirect Page

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    13

    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?

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    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

  3. #3
    Junior Member
    Join Date
    Mar 2012
    Posts
    13
    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).

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    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?

  5. #5
    Junior Member
    Join Date
    Mar 2012
    Posts
    13
    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.

  6. #6
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    would you mind to post your website address

    Musicman

  7. #7
    Junior Member
    Join Date
    Mar 2012
    Posts
    13
    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)

  8. #8
    Member
    Join Date
    Feb 2012
    Location
    Cairns - Great Barrier Reef - Australia
    Posts
    86
    and it just got creepy!... Bye Bye Blitz....
    Defy the boundaries!.. NEVER surrender to the code!!!.....

  9. #9
    Junior Member
    Join Date
    Mar 2012
    Posts
    13
    lol, bye back2012

    Anyone there? Is it possible to do this?

  10. #10
    Junior Member
    Join Date
    Mar 2012
    Posts
    13

    Question


  11. #11
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    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

  12. #12
    Junior Member
    Join Date
    Mar 2012
    Posts
    13
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center