<? $tsql=$empire->query("select (@i:=@i+1) i,tagid from {$dbtbpre}enewstagsdata , (SELECT @i:=0) as i where id='$navinfor[id]' and classid='$navinfor[classid]' "); while($tr=$empire->fetch($tsql)){ $tt=$empire->fetch1("select * from {$dbtbpre}enewstags where tagid=...
<?php $hits_r = $empire->query("select * from {$dbtbpre}ecms_news as t1 join (select round(rand() * ((select max(id) from {$dbtbpre}ecms_news)-(select min(id) from {$dbtbpre}ecms_news))+(select min(id) from {$dbtbpre}ecms_news)) as id) as t2 where t1.id >= t2.id and t1.classid = {$...
提取文章所有图片scr$imgurls = '';//文章 $pattern="/<img.*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/"; preg_match_all($pattern,$imgurls,$match); //取出符合条件的 $new_arr=array_unique($match[0]);//去除数组中重复的值 foreach($new_arr as $key){ $p="#src=('|\")(.*)('|\"...
sqlite.class.php<?php class SQLite { public $file; public $db; public $query; public $prepare; // const IS_INT = 1; const IS_STR = 2; const ASSOC = 1; const NUM = 2; const BOTH = 3; function __construct($base, $mode = 0666, $auto = true) { ...
复制推荐 var url = "文章标题 "+window.location.href;document.getElementById('Url').value=url ;var clipboard = new ClipboardJS('#copy');clipboard.on('success',function(e){e.clearSelection();layer.msg('复制成功!');});clipboard.on('error',function(e){e.clearSelection();layer.msg('复制失...
php模拟get提交 字符串截取 字符串替换 示例源码<?php$qq = $_GET[qq]; //获取http://gxtest.sinaapp.com/get.php?qq=843516495网址的QQ参数843516495$url = 'http://qun.594sgk.com/qq/'.$qq.'.html';//整理好网址http://qun.594sgk.com/qq/843516495.html$data = file_get_contents($url);//模拟get提交http://qun.594sgk.com/qq/843516495.html$data=...
php限定时间内同一ip只能访问一次 建立一个数据表 CREATE TABLE clicks ( ip INT UNSIGNED NOT NULL , time1 INT UNSIGNED NOT NULL , time2 INT UNSIGNED NOT NULL , PRIMARY KEY ( ip ) ) ENGINE = MYISAM 获取ip和当前时间插入到数据表 INSERT INTO clicks (ip,time2) VALUES (INET_ATON('{$_SERVER["REMOTE_ADDR"]}'),UNIX_TIMESTAMP()) ON DUP...
php实现只保留mysql中最新1000条记录 这篇文章主要介绍了php实现只保留mysql中最新1000条记录的方法和相关示例及数据库结构,十分的全面,有需要的小伙伴可以参考下。<?php mysql_connect("localhost","root","root"); mysql_select_db("test"); //保留最新的1000条记录 $limit=1000; $query="select `id` from `news`"; $result=mysql_quer...
<?php$min_seconds_between_refreshes = 5;#设置刷新的时间session_start();if(array_key_exists('last_access', $_SESSION) && time()-$min_seconds_between_refreshes <= $_SESSION['last_access']) { // The user has been here at least $min_seconds_between_refreshes seconds ago - block themexit('5秒可刷...
$text1=escape_string(text1);$text2=escape_string(text2);insert into MINGYAN (Content1,Content2,Content3,View) VALUES ('$text1','$text2','$time',0);function escape_string($string, $quotestyle='both') { if( function_exists('sqlite_escape_string') ){ $string = sqlite_escape_string($strin...