Location (ip range) based content |
Post Reply |
Author | |
LP-
Newbie Joined: Oct 30 2014 Status: Offline Points: 12 |
Post Options
Thanks(0)
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.
|
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(2)
|
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 } ?> |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |