du060334 2014-04-15 04:52
浏览 49

如何显示特定页面的消息?

If I have a code to display the links of Page. and I want to show a message "You are in this page" what should I do? my code to display links of pages is

if( $page > 1 ) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.($page-1).'&date1='.$_REQUEST["date1"].'&date2='.$_REQUEST["date2"].'">Previous</a>';
}
for( $i = 1; $i < $totalPages; $i++){
    echo '&nbsp;&nbsp;<a href="'.$_SERVER['PHP_SELF'].'?page= '. $i .'&date1='.$_REQUEST["date1"].'&date2='.$_REQUEST["date2"].'">' . $i . '</a>&nbsp;&nbsp;';
}
if( $page < $totalPages ) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.($page+1).'&date1='.$_REQUEST["date1"].'&date2='.$_REQUEST["date2"].'">Next</a>';
}
  • 写回答

2条回答 默认 最新

  • dpfwhb7470 2014-04-15 05:02
    关注

    On the landing page, you can check for $_GET['page']:

    switch ($_GET['page']) {
    
      case 2: 
        'Do Something for page 2';
         break;
    
      case 3: 
        'Do Something for page 3';
         break;
    
      case 4: 
        'Do Something for page 4';
         break;
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度