我有一部嵌入的电影,并试图建立一套能够让我看到用户以前到这里来的功能。 如果他们这样做,就会伪造汽车。
the followig code does not work <?php
function autoplay(){
if ($REMOTE_ADDR == "") {
$ip = "no ip";
echo "true";
}
else{ $ip = getHostByAddr($REMOTE_ADDR);
echo "false";
}
}
?>
任何建议
我有一部嵌入的电影,并试图建立一套能够让我看到用户以前到这里来的功能。 如果他们这样做,就会伪造汽车。
the followig code does not work <?php
function autoplay(){
if ($REMOTE_ADDR == "") {
$ip = "no ip";
echo "true";
}
else{ $ip = getHostByAddr($REMOTE_ADDR);
echo "false";
}
}
?>
任何建议
you could use a cookie that will be stored in the user s browser. session_start(); before everything else in the page, then setcookie( visited , yes ,$time+2592000); after that before loading the movie check if $_COOKIE[ visited ] == "yes"; and thats it. 2592000 are the seconds in a month. Paste this at the first line of your page:
<? session_start(); $loopif=($_COOKIE[ visited ]=="yes")?false:true;setcookie( visited , yes ,$time+2592000); ?>
然后,当用户事先访问时,当他打算这样做时,便会发生错失行为。
结束
建立了两个职能,并参照了嵌入的汽车部分的自动作用。
function ipfunction() {
$ip=$_SERVER[ REMOTE_ADDR ];
$queryone = "SELECT * from sessions where ip= $ip ";
$result = mysql_query($queryone);
if (mysql_num_rows($result) == 0) {
mysql_query("insert into `sessions` (`id`, `session`, `ip`) VALUES ( , , $ip )");
} else if (mysql_num_rows($result) != 0) {
echo "";
}
}
function autoplay() {
$ip=$_SERVER[ REMOTE_ADDR ];
$queryone = "SELECT * from sessions where ip= $ip ";
$result = mysql_query($queryone);
if (mysql_num_rows($result) == 0) {
echo "true";
} else if(mysql_num_rows($result) != 0) {
echo "false";
}
}
What are the advantages/disadvantages of using include/require s to achieve a singular file that contains multiple pages as opposed to directing the user to many individual pages and storing the ...
I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...
What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...
I am storing an array of a custom serializable class in session on my site. When a page on the site changes, suddenly it renders them invalid, and tells me that it can t cast the type to it s own ...
I ve tried searching for this but it s pretty difficult to put into words. Basically, our site will run fine for most users without any issues. Sometimes though, those of us who use the site pretty ...
Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...
提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......
I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...