当前位置: 澳门新濠3559 > 编程 > 正文

得出了从一个例子入手来学习是最快最有效,$

时间:2019-11-22 20:51来源:编程
=====Article.php==== if{ $pagenum=1;}$conn=mysql_connect("localhost","user","password"); mysql_select_db;$sql="select count from article"; $result=mysql_query;$count=mysql_result; $sign=0; $lesssign=0; $pagec=1; for($icount=0;{for{ if==$cou

=====Article.php==== if{ $pagenum=1;} $conn=mysql_connect("localhost","user","password"); mysql_select_db; $sql="select count from article"; $result=mysql_query; $count=mysql_result; $sign=0; $lesssign=0; $pagec=1; for($icount=0;&&{ for{ if==$count) $sign=1; } $pagec++; } $dispeof=16*$pagenum; $dispend=16*; if) $dispbeg=16*$pagenum; else $dispbeg=$count; $isdispnum=$count-$dispeof; if{ $lesssign=1; } echo"

自学习这么多年来讲,得出了从叁个例证出手来读书是最快最平价,并能培育出很强的施行技术,那是一种很
好的学习方式。不访试试。比如看一本书的时候从各章节的例证入手,寻觅不掌握的以致不懂的只怕新知识,
接着有针对性的就学。看看上边包车型地铁例证:
<?php
$ip = getenv("REMOTE_ADDR");
//echo "$ip";
$conn=mysql_connect('ip','root','****');
mysql_select_db('db',$conn);
$sql="select *from counter where ip="$ip";";
$result=mysql_query($sql,$conn);
$num=mysql_num_rows($result);
$count=mysql_query("select*from counter",$conn);
$count=mysql_num_rows($count);
//echo "$num";
//echo "$count";
if($num==0)
{
$sum=1;
$count ;
$sql="insert into counter(ip,sum,countdata)values('$ip','1','$count')";
mysql_query($sql,$conn);
mysql_close($conn);
//echo "$count";
}
else
{
$my="select sum from counter where ip='$ip'";
$bbbbbb=mysql_query($my) or die(mysql_error());
$row=mysql_fetch_Array($bbbbbb);
@$sum=$row[sum];
//echo "$sum";
$sum ;
$sql="update counter set sum='$sum' where ip='$ip'";
mysql_query($sql);
mysql_close($conn);
}
$str_count=strval($count);
$str_count=Chop($str_count);
$count_len=strlen($str_count);
$image_count="";
if($count_len<6)
{for($j=0;$j<6-$count_len;$j )
{$image_count=$image_count."<img src='0.gif'>";
}
}
for($i=0;$i<$count_len;$i )
{
$nom=substr($str_count,$i,1);
$image_count = $image_count."<img src='";
$image_count = $image_count.$nom;
$image_count = $image_count.".gif'>";
}
echo"$image_count<br>";
print"那是你的第".$sum."次访问";

三个十分不时的机遇,在网络来看了有人用PHP+MYSQL作了二个访客签到簿, 那时认为很有用项所以自己也很 想搞三个。不过用MYSQL认为有一点在材小用,所以就搞了二个依据文本的访客签到簿。其效用与本身在网络看到的用MYSQL作的几近,在此边本身将其源码发表,希望它对松开网络朋友学习PHP有所匡助。限于自家的档次, 个中定有BUG,还指望相爱的人开采了不用忘告诉小编刹那间。本签到簿由要三个文本组成:一个是存放签到音讯的sign.txt文件, 该公文能够由NOTEPAD来成立;第二个是拍卖消息的sign.php文件。在斑竹园的主页有它的亲自去做,接待去拜望。上边便是sign.php的源代码: sign.php if&&isset{ $name=ltrim; $t=date; $dat="[".$t."]"; $msg=ltrim; $name=trim; $msg=trim; $pristr=$name."  ".$dat." ".$msg."n"; $f=fopen("sign.txt","a"); fwrite; fclose; } $file=file; if{ $pagenum=1; } $lesssign=0; $num=count; $dispnumed=6*; $dispnumbeg=$num-$dispnumed; $artnumeof1=6*$pagenum; $isdispnum=$num-$artnumeof1; if{ $dispnumeof=1; $lesssign=1; } else{ $dispnumeof=$isdispnum+1; } $sign=0; $pagec=0; for($icount=0;&&{ for{ if{ $sign=1; } } $pagec++; } $pagecount=$pagec; echo"

"; $fuhao="◇"; $color=e9eae9; $iscolor=0; $lessnum=0; for($i=$dispbeg;$i>$dispend;$i--){ $sql="select *from article where id='$i'"; $result=mysql_query; echo"

"; $fuhao="◇"; $color=e9eae9; $iscolor=0; $lessnum=5; echo"

"; echo $fuhao; echo""; $obj=mysql_fetch_object; echo $obj->articlename; echo"

"; echo"斑竹园签到簿"; echo"

"; $lessnum++; if{ $color=ffffff; $iscolor=1; } else{ $color=e9eae9; $iscolor=0; } } if{ for($iless=$lessnum;$iless<=16;$iless++){ echo"

"; for($i=$dispnumbeg;$i>=$dispnumeof;$i--){ $linknum=$num-$i; $lessnum--; $stringmsg1=$file[]; $stringmsg2=strrev; $stringmsg3=strstr($stringmsg2,"psbn"); $stringmsg=strrev; "); $dispvar=$fuhao.$stringmsg; echo"

"; echo $fuhao."
n"; echo"

"; echo$dispvar; echo "图片 1"; echo""; echohttps://www.jb51.net/article/$stringlink; echo""; echo"

"; if{ $color=ffffff; $iscolor=1; } else{ $color=e9eae9; $iscolor=0; } } } echo"

"; if{ $color=ffffff; $iscolor=1; } else{ $color=e9eae9; $iscolor=0; } } if{ for($iless=$lessnum;$iless>0;$iless--){ echo"

"; ?> echo"

"; echo $fuhao."
n"; echo"

"; $str="共有"; $str=$str.strval; $str=$str."页"; echo"

"; if{ $color=ffffff; $iscolor=1; } else{ $color=e9eae9; $iscolor=0; } } } echo"

$str"; echo"

"; echo""; echo"

"; echo"

"; echo"

"; $str="当前页是第"; $str=$str.strval; $str=$str."页"; echo $str; echo"

"; ?>

"; echo"

"; echo"转到第"; for{ $strpage=" "; $strpage=$strpage.strval; $strpage=$strpage." "; echo"$strpage"; } echo"页"; echo"

"; echo"

"; echo"

"; mysql_close

编辑:编程 本文来源:得出了从一个例子入手来学习是最快最有效,$

关键词: