BullGuard Antivirus Sale - 60% Off with openElement !
Forum Home Forum Home >

openElement

> openElement General Discussion
  New Posts New Posts RSS Feed - Location (ip range) based content
  FAQ FAQ  Forum Search   Register Register  Login Login

Location (ip range) based content

 Post Reply Post Reply
Author
Message
LP- View Drop Down
Newbie
Newbie


Joined: Oct 30 2014
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote LP- Quote  Post ReplyReply Direct Link To This Post Topic: Location (ip range) based content
    Posted: Oct 03 2017 at 12:57pm
Any way to make custom content based on client's ip address ? I searched the forum but didn't find anything.
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group


Joined: May 31 2012
Status: Offline
Points: 5283
Post Options Post Options   Thanks (2) Thanks(2)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Oct 03 2017 at 3:04pm
Hi.

First of all, you can use PHP to get the IP address, then it depends on what you want to do with it.

Set your page to PHP mode (Page->Server scripts or Extention->PHP).

Example of what you can do:

1) Add a Group of Elements on the page, set its Positioning mode to "relative".Add a Code Block (Visual) with the code:

<?php if ($_SERVER['REMOTE_ADDR'] == '123.45.67.89') { ?>

2) Then, on the next "line" or several lines, (line is highlit by orange borders when an element inside it is selected), add content for this IP address.

3) Then, again on the next line (not same lime with the content), add one more Code Block Visual with the code

<?php } elseif ($_SERVER['REMOTE_ADDR'] == '223.45.67.80') { ?>

4) Repeat 2)

5) Repeat 4) and 2) as long as necessary

6) When all content is there, the final Code Block Visual should be

<?php } ?>


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.