On some DJ Panels there is a script were users can only view a page once dose any one no it

On some DJ Panels there is a script were users can only view a page once dose any one no it
Lets make the map red again
T4 on the beach 2009 woo
Need help PM me Im always happy to help, more then the guys at Asda
I'm not good at thinking logically but the first thing that comes to my head is having a mysql db and inserting the users IP into it and checking if the user has viewed thepage using their IP if so tell them no if not let them view:
There might be a much easyer way to do this I just can't think atm. Hope it helps.PHP Code:<?php
$dbuser = "username";
$dbpass = "pass";
$dbname = "databasename";
$dbhost = "localhost";
//Change the values to your details for accessing the database..
$connect = mysql_connect($host, $dbuser, $dbpass);
mysql_select_db($dbname, $connect);
//Connect to the database..
$ip = $_SERVER['REMOTE_ADDR'];
//The users IP
$get = mysql_query("SELECT * FROM `tablename` WHERE `ip` = '" . $ip . "'");
//Check the database for any maches..
if(mysql_num_rows($get) > 0)
{
echo("No access already been viewed by this person..");
}
else
{
echo("Page content..");
mysql_query("INSERT INTO `tablename` (`ip`) VALUES ('" . $ip . "')");
//Add the users IP to the db to prevent them from accessing again..
}
?>
Last edited by Jme; 02-01-2008 at 04:18 AM.
Want to hide these adverts? Register an account for free!