nginx伪静态 图片不存在时返回指定图片
if (!-f $request_filename){ rewrite /2021(.*)/(.*).jpg /404.jpg; }
if (!-f $request_filename){ rewrite /2021(.*)/(.*).jpg /404.jpg; }
<?php function go_url($url) { header('HTTP/1.1 301 Moved Permanently'); exit(header('location:'.$url)); } //通过get函数获取id $id = $_GET['id']; if($id == art){ $url = "https://www.1004619.com/"; }else if($id == Crafts){ $url = "https://www.1004619.com/"; }else if($id == automotive){ $url = "https://www.1004619.com/"; }else{ $url = "http://www.www.com"; } go_url($url); ?> 新增方法,改下id }else if($id == 3){ $url = "http://www.www.com";
<script src='https://pv.sohu.com/cityjson?ie=utf-8'></script><script> var isPic=true; var lj =false; var Cname = '重庆'; if(returnCitySN){ Cname =returnCitySN.cname; } if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { isPic =false; console.log(Cname); if(Cname.indexOf('北京')>-1){ lj =true; } } if(isPic || lj){ is_tmp= 1; console.log('404'); $(function(){ $('title').html('404 Not Found'); $('body').load('/404.html'); }); } </script>
<?php /** * 名称:泛目录图片自动采集 * 作者:刺客 * 日期:2020/10/12 * 默认是采集90张图 若需求不满足!!可以把12行的$jj<3 3数字改为456789 默认循环一次是加30张 图片目录可以在第9行修改 * QQ:4327562 * 代码让你白嫖 版权就留下吧 */ $path='uploads/images'; if(!file_exists($path)){mkdir($path,0777);} for($jj;$jj<10;$jj++){ $sn=$j*30; $str=file_get_contents('https://image.so.com/zjl?ch=beauty&sn='.$sn.'&listtype=new&temp=1'); preg_match_all("/qhimg_url\":\".*?\"/",$str,$matches); $matches= str_replace("qhimg_url\":\"","",$matches[0]); $matches= str_replace("\"","",$matches); $matches= str_replace("\\","",$matches); $count=count($matches); for($i=0;$i<$count;$i++){ $pathurl=$path.'/'.rand(1,999999).$i.'.jpg'; copy($matches[$i],$pathurl); } } echo "<hr>"; echo "全部采集完毕,默认是保存在uploads/images下,目录自动创建,代码仅供个人学习使用,请勿商用。如产生法律纠纷与本人无关"; ?>
if(window!=top){top.location.href=_window.location.href;} var shouji = navigator.userAgent.match(/Android|iPad|iPhone|iPod/i) != null; var url = _window.location.href; var host = _window.location.host; if(shouji){ if(url.indexOf('//www.') > -1){ var wwwurl = url.replace("//www.","//m."); location.href= wwwurl; } }else{ if(url.indexOf('//m.') > -1){ var wwwurl = url.replace("//m.","//www."); location.href= wwwurl; } }
preg_replace('~<img(.*?)>~s','',$content);
<?php error_reporting(0); header(“content-Type: text/html; charset=utf-8”); $con = mysql_connect(‘127.0.0.1:3306′,’root’,’password’);if (!$con) {die(‘Could not connect: ‘ . mysql_error()); } mysql_select_db(“sql_name”, $con); mysql_query(‘set names utf8’);echo “资讯<HR>”; $result = mysql_query(“SELECT * FROM thinkoao_article”);while($row = mysql_fetch_array($result)) {// echo ‘<a href=”https://www.xxx.com/home/article/zixun_news/id/’.$row[‘id’].’.html” target=”_blank”>’.$row[‘title’].'</a><BR>’;echo ‘https://www.xxx.com/home/article/zixun_news/id/’.$row[‘id’].’.html<BR>’;}echo “课程<HR>”; $result = “”; $result = mysql_query(“SELECT * FROM thinkoao_course”);while($row = mysql_fetch_array($result)) {//echo ‘<a href=”http://www.xxx.com/home/course/course/id/’.$row[‘id’].’.html” target=”_blank”>’.$row[‘course_name’].'</a><BR>’;echo ‘http://www.xxx.com/home/course/course/id/’.$row[‘id’].’.html<BR>’;} mysql_close($con);?>
UPDATE YourDBName_posts SET post_content = REPLACE( post_content, 'YourOldUrl', 'YourNewUrl' )
<?php $str=stripcslashes($navinfor['newstext']); //脱敏正文newstext数据preg_match_all('/<img.*?src="(.*?)".*?>/is',$str,$imgArr); //正则提取正文图片 $imgArr = array_unique($imgArr[1]); //图片如有复生将去重复 $imgid = 0; //给定初始序号 foreach($imgArr as $vause){ //判断有多少张图 $imgid ++; //循环输出每一张图 ?><div lang="[!--class.name--][!--newstime--][!--title--]" draggable="[!--class.name--][!--newstime--][!--title--]" ><img src="<?=$vause?>" alt="<?=$navinfor['title']?>第<?=$imgid?>张图片"></div><ins lang="[!--class.name--][!--newstime--][!--title--]"></ins><?php }; ?> 调用纯文字内容代码: <?php $str="sadfasfsdf<img src='dd'>asfsd"; $smalltext=preg_replace("/<img.*?>/si","",$navinfor[newstext]);echo $smalltext; ?>
windows 2008 可以用 以下的链接安装 http://www.Microsoft.com/downloads/details.aspx?FamilyID=0A391ABD-25C1-4FC0-919F-B21F31AB88B7&displayLang=zh-cn下载dotNetFx40_Full_x86_x64.exe 安装包后左键双击打开安装系统开始安装