re: [PHP] 1 Time visit only
All I could think of is, Say the page in question, Checks if you have a certain cookie, and if you have it, You get denied access, And On your First official Visit of the page, It gives that certain Cookie that it looks for in the beginning. Of course all they would have to do is Delete there cookies.
Sorry if It didn't help.
re: [PHP] 1 Time visit only
Or prehaps storing their ip instead of cookie's
re: [PHP] 1 Time visit only
Yea it could be something like i use msql so;
that when they visit the page it needs some code in .php like
''mysql_query("INSERT INTO specialpage
(ipadress)
VALUES ('".$remote_ip.")") or die(mysql_error());''
$sql = mysql_query("SELECT * FROM specialpage WHERE apadress='$_SERVER[REMOTE_ADDR]'");
if(mysql_num_rows($sql) > 0) {
echo "<center><br><br><br>You already visited this page.";
echo '<meta http-equiv="refresh" content="15; url=index.php"> ';
die;
Something like that? or.. (i really dont know im a noob in php xD)
re: [PHP] 1 Time visit only
Can't you do like
PHP Code:
IF $_COOKIE['IP']); then
GOTO 503 else
show 1pageonlyone
re: [PHP] 1 Time visit only
re: [PHP] 1 Time visit only
Quote:
Originally Posted by
habmoon
Yea it could be something like i use msql so;
that when they visit the page it needs some code in .php like
''mysql_query("INSERT INTO specialpage
(ipadress)
VALUES ('".$remote_ip.")") or die(mysql_error());''
$sql = mysql_query("SELECT * FROM specialpage WHERE apadress='$_SERVER[REMOTE_ADDR]'");
if(mysql_num_rows($sql) > 0) {
echo "<center><br><br><br>You already visited this page.";
echo '<meta http-equiv="refresh" content="15; url=index.php"> ';
die;
Something like that? or.. (i really dont know im a noob in php xD)
PHP Code:
$a = mysql_query("SELECT * FROM table WHERE ip = '".$_SERVER[REMOTE_ADDR]."'");
$b = mysql_num_rows($a);
if($b > 0){
echo 'You already been here.';
}else{
mysql_query("INSERT INTO table (ip) VALUES ("'".$_SERVER[REMOTE_ADDR]."'"));
echo 'hey welcome';
}
Re: [PHP] 1 Time visit only
Use cookies if it's just for user convenience (it doesn't care if they re-view the page, but if they don't, it's better), or store IP's in the DB, or let them make accounts and use the account ID if a user may under no circumstance re-view the page (with his IP / account).
Re: [PHP] 1 Time visit only
Idea about storing IP's is better because users can simply delete this cookie...
Re: [PHP] 1 Time visit only
Quote:
Originally Posted by
zingmars
Idea about storing IP's is better because users can simply delete this cookie...
He can also simply just use a Proxy, :P
Re: [PHP] 1 Time visit only
Well most people only use popular proxy's, so 1 time use and that ip is registed to.
Re: [PHP] 1 Time visit only
Thank you for helping :}
~Problem fixed, thanks again :)