Welcome to WebmasterWorld Guest from 54.227.101.214

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Allowing 'registered' members to view different content then 'non reg'

Registered users seeing different content

     

brettxw

7:39 am on Feb 8, 2011 (gmt 0)



I know how to set it so the download link is not visible for 10 seconds (timed countdown) How would I go about setting it so viewers who are not logged in (or not registered users) see the 10 second countdown before being able to click the link, however if they are a registered member and have logged in, they see the link with out the countdown delay.

Kings on steeds

5:53 am on Feb 10, 2011 (gmt 0)

10+ Year Member





session_start();

if(!isset($_SESSION['user'])){
echo "<script>start_count_down();</script>";
} else {
echo "<a href='link'>download my thing</a>";
}


This code assumes you have a time Javascript, that should go in the script tag. it also assumes you have some code settings the user session. (e.g. a login script)

If you know what their IP's are you could do it using

$ips = array('1.1.1.1','2.2.2.2','3.3.3.3');
if(!in_array($_SERVER['REMOTE_ADDR'], $ips)){


Good luck :-)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month