php代码|无限生成网站,技巧静态-SEO专用(php 代码生成)
时间:2021-11-13 21:31:06 阅读:1519
这是一个可以无限生成各种文章或者网站单页的代码技巧,由多个php和html页面组成,如果不明白的话,请按照流程设置。
创建wz文件夹,创建images文件夹,创建php文件夹,创建txt文件夹。
wz文件夹创建后,不用理会。images文件夹是用来放图片的,随机上传一些自己喜欢的图片即可。
在php文件夹里面创建sj.php文件,里面放以下代码:
<?php error_reporting(0); $refer=$_SERVER['HTTP_REFERER']; if(stristr($refer,"baidu.com")||stristr($refer,"sogou.com")||stristr($refer,"soso.com")||stristr($refer,"google.")||stristr($refer,"bing.com")||stristr($refer,"youdao.com")) { header("location:http://www.主域名/");//这个是跳转地址,放你的主域名 exit(); } $Titleline=file('./txt/key.txt'); $pictures=file('./txt/img.txt'); $Contentline=file('./txt/ceshi.txt'); $TY=count($pictures); $TC=count($Titleline); $CC=count($Contentline); $xyy=file('./txt/xyy.txt'); $HY=count($xyy); function Gexyy($id) { global $xyy; $str=$xyy[$id]; return $str; } $xyy0=trim(Gexyy(rand(0,$HY))); $xyy1=trim(Gexyy(rand(0,$HY))); $xyy2=trim(Gexyy(rand(0,$HY))); $xyy3=trim(Gexyy(rand(0,$HY))); function Getpictures($id) { global $pictures; $str=$pictures[$id]; return $str; } function gettitle($id) { global $Titleline; $str=$Titleline[$id]; return $str; } function getcontent($id) { global $Contentline; $str=$Contentline[$id]; $str=str_replace("{title}","",$str); return $str; } $pictures0=trim(Getpictures(rand(0,$TY))); $pictures1=trim(Getpictures(rand(0,$TY))); $pictures2=trim(Getpictures(rand(0,$TY))); $pictures3=trim(Getpictures(rand(0,$TY))); $pictures4=trim(Getpictures(rand(0,$TY))); $pictures5=trim(Getpictures(rand(0,$TY))); $pictures6=trim(Getpictures(rand(0,$TY))); $pictures7=trim(Getpictures(rand(0,$TY))); $pictures8=trim(Getpictures(rand(0,$TY))); $pictures9=trim(Getpictures(rand(0,$TY))); $pictures10=trim(Getpictures(rand(0,$TY))); $pictures11=trim(Getpictures(rand(0,$TY))); $pictures12=trim(Getpictures(rand(0,$TY))); $pictures13=trim(Getpictures(rand(0,$TY))); $pictures14=trim(Getpictures(rand(0,$TY))); $pictures15=trim(Getpictures(rand(0,$TY))); $pictures16=trim(Getpictures(rand(0,$TY))); $pictures17=trim(Getpictures(rand(0,$TY))); $pictures18=trim(Getpictures(rand(0,$TY))); $pictures19=trim(Getpictures(rand(0,$TY))); $pictures20=trim(Getpictures(rand(0,$TY))); $pictures21=trim(Getpictures(rand(0,$TY))); $pictures22=trim(Getpictures(rand(0,$TY))); $pictures23=trim(Getpictures(rand(0,$TY))); $pictures24=trim(Getpictures(rand(0,$TY))); $pictures25=trim(Getpictures(rand(0,$TY))); $pictures26=trim(Getpictures(rand(0,$TY))); $pictures27=trim(Getpictures(rand(0,$TY))); $pictures28=trim(Getpictures(rand(0,$TY))); $pictures29=trim(Getpictures(rand(0,$TY))); $pictures30=trim(Getpictures(rand(0,$TY))); $pictures31=trim(Getpictures(rand(0,$TY))); $pictures32=trim(Getpictures(rand(0,$TY))); $pictures33=trim(Getpictures(rand(0,$TY))); $pictures34=trim(Getpictures(rand(0,$TY))); $pictures35=trim(Getpictures(rand(0,$TY))); $pictures36=trim(Getpictures(rand(0,$TY))); $pictures37=trim(Getpictures(rand(0,$TY))); $pictures38=trim(Getpictures(rand(0,$TY))); $pictures39=trim(Getpictures(rand(0,$TY))); $pictures40=trim(Getpictures(rand(0,$TY))); $pictures41=trim(Getpictures(rand(0,$TY))); $pictures42=trim(Getpictures(rand(0,$TY))); $pictures43=trim(Getpictures(rand(0,$TY))); $pictures44=trim(Getpictures(rand(0,$TY))); $pictures45=trim(Getpictures(rand(0,$TY))); $pictures46=trim(Getpictures(rand(0,$TY))); $pictures47=trim(Getpictures(rand(0,$TY))); $pictures48=trim(Getpictures(rand(0,$TY))); $pictures49=trim(Getpictures(rand(0,$TY))); $pictures50=trim(Getpictures(rand(0,$TY))); $pictures51=trim(Getpictures(rand(0,$TY))); $pictures52=trim(Getpictures(rand(0,$TY))); $pictures53=trim(Getpictures(rand(0,$TY))); $pictures54=trim(Getpictures(rand(0,$TY))); $pictures55=trim(Getpictures(rand(0,$TY))); $pictures56=trim(Getpictures(rand(0,$TY))); $pictures57=trim(Getpictures(rand(0,$TY))); $pictures58=trim(Getpictures(rand(0,$TY))); $pictures59=trim(Getpictures(rand(0,$TY))); $pictures60=trim(Getpictures(rand(0,$TY))); $Title0=trim(gettitle(rand(0,$TC))); $Title1=trim(gettitle(rand(0,$TC))); $Title2=trim(gettitle(rand(0,$TC))); $Title3=trim(gettitle(rand(0,$TC))); $Title4=trim(gettitle(rand(0,$TC))); $Title5=trim(gettitle(rand(0,$TC))); $Title6=trim(gettitle(rand(0,$TC))); $Title7=trim(gettitle(rand(0,$TC))); $Title8=trim(gettitle(rand(0,$TC))); $Title9=trim(gettitle(rand(0,$TC))); $Title10=trim(gettitle(rand(0,$TC))); $Title11=trim(gettitle(rand(0,$TC))); $Title12=trim(gettitle(rand(0,$TC))); $Title13=trim(gettitle(rand(0,$TC))); $Title14=trim(gettitle(rand(0,$TC))); $Title15=trim(gettitle(rand(0,$TC))); $Title16=trim(gettitle(rand(0,$TC))); $Title17=trim(gettitle(rand(0,$TC))); $Title18=trim(gettitle(rand(0,$TC))); $Title19=trim(gettitle(rand(0,$TC))); $Title20=trim(gettitle(rand(0,$TC))); $Title21=trim(gettitle(rand(0,$TC))); $Title22=trim(gettitle(rand(0,$TC))); $Title23=trim(gettitle(rand(0,$TC))); $Title24=trim(gettitle(rand(0,$TC))); $Title25=trim(gettitle(rand(0,$TC))); $Title26=trim(gettitle(rand(0,$TC))); $Title27=trim(gettitle(rand(0,$TC))); $Title28=trim(gettitle(rand(0,$TC))); $Title29=trim(gettitle(rand(0,$TC))); $Title30=trim(gettitle(rand(0,$TC))); $Title31=trim(gettitle(rand(0,$TC))); $Title32=trim(gettitle(rand(0,$TC))); $Title33=trim(gettitle(rand(0,$TC))); $Title34=trim(gettitle(rand(0,$TC))); $Title35=trim(gettitle(rand(0,$TC))); $Title36=trim(gettitle(rand(0,$TC))); $Title37=trim(gettitle(rand(0,$TC))); $Title38=trim(gettitle(rand(0,$TC))); $Title39=trim(gettitle(rand(0,$TC))); $Title40=trim(gettitle(rand(0,$TC))); $Title41=trim(gettitle(rand(0,$TC))); $Title42=trim(gettitle(rand(0,$TC))); $Title43=trim(gettitle(rand(0,$TC))); $Title44=trim(gettitle(rand(0,$TC))); $Title45=trim(gettitle(rand(0,$TC))); $Title46=trim(gettitle(rand(0,$TC))); $Title47=trim(gettitle(rand(0,$TC))); $Title48=trim(gettitle(rand(0,$TC))); $Title49=trim(gettitle(rand(0,$TC))); $Title50=trim(gettitle(rand(0,$TC))); $Title51=trim(gettitle(rand(0,$TC))); $Title52=trim(gettitle(rand(0,$TC))); $Title53=trim(gettitle(rand(0,$TC))); $Title54=trim(gettitle(rand(0,$TC))); $Title55=trim(gettitle(rand(0,$TC))); $Title56=trim(gettitle(rand(0,$TC))); $Title57=trim(gettitle(rand(0,$TC))); $Title58=trim(gettitle(rand(0,$TC))); $Title59=trim(gettitle(rand(0,$TC))); $Title60=trim(gettitle(rand(0,$TC))); $Title61=trim(gettitle(rand(0,$TC))); $Title62=trim(gettitle(rand(0,$TC))); $Title63=trim(gettitle(rand(0,$TC))); $Title64=trim(gettitle(rand(0,$TC))); $Title65=trim(gettitle(rand(0,$TC))); $Title66=trim(gettitle(rand(0,$TC))); $Title67=trim(gettitle(rand(0,$TC))); $Title68=trim(gettitle(rand(0,$TC))); $Title69=trim(gettitle(rand(0,$TC))); $Title70=trim(gettitle(rand(0,$TC))); $Title71=trim(gettitle(rand(0,$TC))); $Title72=trim(gettitle(rand(0,$TC))); $Title73=trim(gettitle(rand(0,$TC))); $Title74=trim(gettitle(rand(0,$TC))); $Title75=trim(gettitle(rand(0,$TC))); $Title76=trim(gettitle(rand(0,$TC))); $Title77=trim(gettitle(rand(0,$TC))); $Title78=trim(gettitle(rand(0,$TC))); $Title79=trim(gettitle(rand(0,$TC))); $Title80=trim(gettitle(rand(0,$TC))); $Title81=trim(gettitle(rand(0,$TC))); $Title82=trim(gettitle(rand(0,$TC))); $Title83=trim(gettitle(rand(0,$TC))); $Title84=trim(gettitle(rand(0,$TC))); $Title85=trim(gettitle(rand(0,$TC))); $Title86=trim(gettitle(rand(0,$TC))); $Title87=trim(gettitle(rand(0,$TC))); $Title88=trim(gettitle(rand(0,$TC))); $Title89=trim(gettitle(rand(0,$TC))); $Title90=trim(gettitle(rand(0,$TC))); $Title91=trim(gettitle(rand(0,$TC))); $Title92=trim(gettitle(rand(0,$TC))); $Title93=trim(gettitle(rand(0,$TC))); $Title94=trim(gettitle(rand(0,$TC))); $Title95=trim(gettitle(rand(0,$TC))); $Title96=trim(gettitle(rand(0,$TC))); $Title97=trim(gettitle(rand(0,$TC))); $Title98=trim(gettitle(rand(0,$TC))); $Title99=trim(gettitle(rand(0,$TC))); $Title100=trim(gettitle(rand(0,$TC))); $Title101=trim(gettitle(rand(0,$TC))); $Title102=trim(gettitle(rand(0,$TC))); $Title103=trim(gettitle(rand(0,$TC))); $Title104=trim(gettitle(rand(0,$TC))); $Title105=trim(gettitle(rand(0,$TC))); $Title106=trim(gettitle(rand(0,$TC))); $Title107=trim(gettitle(rand(0,$TC))); $Title108=trim(gettitle(rand(0,$TC))); $Title109=trim(gettitle(rand(0,$TC))); $Title110=trim(gettitle(rand(0,$TC))); $Title111=trim(gettitle(rand(0,$TC))); $Title112=trim(gettitle(rand(0,$TC))); $Title113=trim(gettitle(rand(0,$TC))); $Title114=trim(gettitle(rand(0,$TC))); $Title115=trim(gettitle(rand(0,$TC))); $Title116=trim(gettitle(rand(0,$TC))); $Title117=trim(gettitle(rand(0,$TC))); $Title118=trim(gettitle(rand(0,$TC))); $Title119=trim(gettitle(rand(0,$TC))); $Title120=trim(gettitle(rand(0,$TC))); ?>
继续在php文件夹里面,创建zhizuo.php文件,里面放以下代码:
<?php $urls="http://www.主域名/wz/index.html";//定义要采集的路径 $fo=fopen($urls,"r");//以只读方式打开url $content=@file_get_contents($urls);//通过url获取内容 echo $content;//打印对应网站内容 //eregi("<title>(.*)</title>",$content,$titles);//用正则表达式读取网站title标签内容 print_r($content);//打印数组title //$tijiao = $_POST['tijiao'];/www/wwwroot/www.clxsite.cn/ $fc = file_get_contents("/www/wwwroot/域名/wz/txt/wz.txt"); $fff = fopen("/www/wwwroot/域名/wz/txt/wz.txt", "w"); $count =$fc+1; $paths="/www/wwwroot/域名/wz/wz/wz".$count.".html";//定义要生成的html路径 $handles=fopen($paths,"w");//以可写方式打开路径 fwrite($handles,$content);//写入内容 fclose($handles);//关闭打开的文件 $fd = fwrite($fff,$count); fclose($fff); ?>
在txt文件夹里面,创建ceshi.txt文件,在里面放一些文章或者内容。
在TXT文件夹里面,创建img.txt文件,把在images的图片名称放进去,一行一个,要记得需要后续。
在TXT文件夹里面,创建key.txt文件,里面放一些自己喜欢的关键词,依然是一行一个。
在wz文件夹,创建a.php文件,放以下代码
<?php ob_start();//开启缓存 //下面放代码 ?> <?php //接入动态主要文件 include './php/sj.php'; ?> <!--这里放你喜欢的单页完整代码--> <!-- 这是关键词的php<?=$Title18?> 数字可以修改 这是文章或者内容<?=getcontent(rand(0,$CC))?>,直接放即可 --> <?php //上面放代码 file_put_contents( 'index.html', ob_get_clean() );//把生成的静态内容保存到index.html文件,而不是输出到浏览器 ?> <p>生成新B页面成功</p>
网友评论