跳转页面&回到上一页

1.php

<?php
header('Location:2.php'); //echo不能在其前面
echo '1';

2.js

<?php
echo '2';
echo '<meta http-equiv="refresh" content="10;url=1.php">';

3.js

<?php
echo '4';
echo "<script>location='1.php';</script>";
echo '3';
//echo "<script>location.href='1.php';</script>"; 也行

//回到上一页
//echo "<script type="text/javascript">history.back();</script>";
//回到上两页
//echo "<script type="text/javascript">history.go(-2);</script>";

$User = M('User'); // 实例化User对象
$count = $User->where('status=1')->count();// 查询满足要求的总记录数
$Page = new ThinkPage($count,25);// 实例化分页类 传入总记录数和每页显示的记录数(25)
$show = $Page->show();// 分页显示输出// 进行分页数据查询 注意limit方法的参数要使用Page类的属性
$list = $User->where('status=1')->order('create_time')->limit($Page->firstRow.','.$Page->listRows)->select();$this->assign('list',$list);// 赋值数据集
$this->assign('page',$show);// 赋值分页输出
$this->display(); // 输出模板

原文地址:https://www.cnblogs.com/hfdp/p/5359823.html