您的位置:

php跨页多选(php下拉框多选)

本文目录一览:

PHP下拉列表分页

?

$myurl = "index.php"

$pagestring .= "  跳转到\n select name=\"chg_go\" onchange=\"window.location.href='".$myurl."?page='+this.value;\"\n";

for($a=1;$a=$pagecount;$a++){

if( $a == $page ){

$pagestring .= " option value=\"".$a."\" selected".$a."/option\n";

}

else{

$pagestring .= " option value=\"".$a."\"".$a."/option\n";

}

}

$pagestring .= " /select\n 页  /td\n/tr\n/table";

print ($pagestring);

?

关于PHP分页

一个分页函数,赋好值就可以使用了

/*

'PID 页面中的其它传参连接

'page 要显示的页码

'Vcount 总记录数

'Pnum 每页记录数

'className 超连接样式

*/

function ThePage($Pid,$page=1,$Vcount,$Pnum,$className){

$Pcount = ceil($Vcount/$Pnum);

if($page$Pcount) $page=$Pcount;

$StartPageNum=1;

while($StartPageNum+10=$page){

$StartPageNum=$StartPageNum+10;

}

$EndPageNum=$StartPageNum+9 ;

if($EndPageNum$Pcount) $EndPageNum=$Pcount;

$show = $show."trtd colspan='10' bgcolor='' align='right' style='padding-right:25px;padding-top:5px;' class='".$className."'";

$show = $show."共b".$Pcount."/b页 共有b".$Vcount."/b记录 第b".$page."/b页 跳到第 [ ";

if($StartPageNum1) $show = $show."a class='".$className."' href='?".$Pid."page=".($StartPageNum-1)."' title='前十页'font face='webdings'7/font/a";

for($go=$StartPageNum;$go=$EndPageNum;$go++){

if($go!=$page){

$show = $show."a class='".$className."' href='?".$Pid."page=".$go."'".$go."/a";

}else{

$show = $show."b".$go."/b";

}

$show = $show." ";

}

if($EndPageNum$Pcount) $show = $show."a class='".$className."' href='?".$Pid."page=".($EndPageNum+1)."' title='下十页'font face='webdings'8/font/a";

$show = $show."] 页";

if($page!=1) $show = $show."a class='".$className."' href='?".$Pid."page=1' 首页/a a class='".$className."' href='?".$Pid."page=".($page-1)."'上一页/a";

if($Pcount-$page!=0) $show = $show. "a class='".$className."' href='?".$Pid."page=".($page+1)."' 下一页/a a class='".$className."' href='?".$Pid."page=".$Pcount."'尾页/a";

$show=$show."/tr/td";

return $show;

}

========================附带一个使用例子=============================

?

//设置参数

$page = $_REQUEST["page"];

if($page=="") $page = 1;

$T = $_GET["T"];

if($T=="") $T = 1;

$Pid = "T=".$T."";

$wheresql = "where T = ".$T;

$recordListTable = "zc_news";

$Pnum = 10;

$classname = "lwf";

//以下不用修改

$rs = mysql_query("select count(*) from `".$recordListTable."` $wheresql ");

$Vcount = @mysql_result($rs,0);

@mysql_free_result($rs);

$start = ($page - 1) * $Pnum;

$lastNum = $Vcount - ($page - 1) * $Pnum;

$limit = $lastNum $Pnum ? $Pnum : $lastNum;

$rs = mysql_query("select * from `".$recordListTable."` $wheresql order by orderid desc,ID desc LIMIT $start,$limit");

while($ary = mysql_fetch_array($rs)){

?

tr

td标题/td

/tr

?

}

@mysql_free_result($rs);

echo ThePage($Pid,$page,$Vcount,$Pnum,$classname);

?

php下拉列表能多选么

下拉列表多选不是php的功能,下面的代码就是多选的select了,但是多选后就不是下拉菜单了,下拉菜单无法多选。

select name="education" id="education" multiple="multiple" size="3"

       option value="1"高中/option

       option value="2"大学/option

       option value="3"博士/option

/select