Posted in PHP onFebruary 10, 2014
php判断正常访问和外部访问
<?php session_start(); if(isset($_POST['check'])&&!empty($_POST['name'])){ if($_POST['check'] == $_SESSION['check']){ echo "正常访问"; }else{ echo "外部访问"; } } $token = md5(uniqid(rand(),true)); $_SESSION['check'] = $token; ?> <form method="post" action=""> <input type="text" name="name"/> <input type="text" name="check" value="<?=$token;?>"> <input type="submit">
php判断正常访问和外部访问的示例
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@