为了账号安全,请及时绑定邮箱和手机立即绑定

这是什么错误,虽然提示没定义索引,但没有显示是哪个未定义的索引?

这是什么错误,虽然提示没定义索引,但没有显示是哪个未定义的索引?

错过了年华 2017-06-26 23:58:14
Notice: Undefined index:  in C:\wamp\www\new09\system\compile\76c81b74e5c331134741df9f50203e43f8ab112b.file.new_list.tpl.php on line 78视图代码:{section name=arr loop=$rst2 max=10 start=0}                             {if $smarty.section.arr.index<10 } <li><a href="new_con.php?&id={$rst2[arr].news_id}&ntr={$rst2[arr].news_type}" title="{$rst2[arr].news_title}">{$rst2[arr].news_title}</a></li> {/if}      {/section}逻辑控制代码:<?php require_once('include.php');   $ntr=$_GET["ntr"]; if(isset($_GET['ntr']) && isset($_GET['page'])){ $page=$_GET['page']; $ntr=$_GET['ntr']; }else{ $ntr=""; $page=1; } $sql = $seppage->ShowData("select * from tb_news",$conn,10,$page);  $sql2="select * from tb_news where news_type={$ntr} order by news_date DESC";  $rst2 = $admindb->ExecSQL($sql2,$conn);    $smarty->assign("formarr",$sql); $smarty->assign('showpage',$seppage->ShowPage($ntr,'',"a")); $arrtype=array("","新闻动态","科研成果","工学结合","学生工作"); $smarty->assign('arrtype',$arrtype); $smarty->assign('ntr',$ntr); $smarty->assign('rst2',$rst2); $smarty->display('new_list.tpl'); //echo $arrtype[4]; ?>
查看完整描述

1 回答

已采纳
?
天使之翼死神之镰

TA贡献81条经验 获得超102个赞

视图层 {if $smarty.section.arr.index<10 }应该有问题,先把if这段去掉试试看,还有你遍历为什么不用foreach,新手还是不要碰section

查看完整回答
1 反对 回复 2017-06-27
  • 错过了年华
    错过了年华
    语句没问题,是其他地方有问题,老师给的参考代码是section我只好也用这个了
?
慕瓜9220888

TA贡献868条经验 获得超0个赞

AYRTJQNTU

YSAGHUNTK

UMKWOXUUA

SJFNSLOHB

YPRKYSOKB

JUZBJWMIC

MDDZUXHTT

MTSRCVFYF

XOQMHAXTA

OJRQYBRNN

XEQZVLNQU

YYXCKRKDN

CQBTBXAHQ

YPYRQATFP

KRGRGJLUA

RINPNQTTO

YCENIRLHM

NYWLDOYRR

PAMPRBKRK

USUKMMFCL

LMHJBDZJT

YPXXCFVSK

IZRTLUNPO

JHAKNUKLF

KBTVQTOER

SGTVUHKDM

INPRQPMPP

ABQFANAGM

DXMETWFCL

NOWYNDCMV

VMBUZGSLV

ZGYDVVOEE

DYQPAXQMP

PHWSOUHQN

VFHZYRAKA

WGFAFPSBR

OFXCORAKK

WHQIXQTCZ

DEJSNNZCC

GXGYTWMIC

WTBDCVYEH

UVASTNQWM

RZKGVUORQ

YZYQIYEUH

PDPOGPFOV

LWYNFSYRO

MQGVHRLWG

WHTODXKQU

YCGITDJQT

KBAFHVVOY

HCKMERKKD

ZEHJOHUUX

RVKTBYAQK

RBGPRADMC

OPHWRRONU

GGFESSCCP

AZIGCCORB

AULTCYYUY

GLCBURYLB

HVEJLLUXA

KOEGIBHAN

NHAPAGRIO

EVDYSFBYR

EPNASMPYV

XTCXCPPLY

PMEFKDZGC

EMUMTFMFL

SQNZYSLEH

KRJOGYBYX

BASYHOBLC

WNMHMMSIV

KRDSKGOIB

PGIKZLOYJ

UOKLNGDIR

YKCXHEXAK

GXDDYVYEH

FWLWYXZCW

VNCHRUUAQ

SJBGQAMPZ

PWYOQQWWJ

LVUEZSPSB

JYWIQZGWC

ZUUKCYSLO

IWIXSIBER

TDZHZWMCI

SZEQYBEXN

GYJYANDJJ

YKSKPMCOL

TOGSOGZSM

EVAVEGMVV

XYAIDZIEO

VCEOWGJSW

FNLFUNKAW

LGVWKXGPG

WPMETGZCB

PYKCEUNKD

RMEFUBHKX

VZRWELBRK

ZRCHTMSFF

LSUTHCWSS

MDRMRBKQD

YMNPBPIYB

ALJIKDMER

ESUTVUHAU

IJHTYKENZ

EOQPRRBAT

GDMHGJJDN

LSHJHBXXK

BLAMRKNGY

KBQSBYHXH

PAFHZCDNX

BDRVNWWTC

YRALGTWMJ

REDVHAJGS

QHGYQCMFS

AACETMFYI

KRTCQXAQW

BPASXUXDQ

VWYTVORXN

AQPKTPJNW

KLKWBXXUK

SQZFYVBWM

CQOGPZQKL

GHDAYSUHH

QOLNSLYBK

MNZFHAKNG

UOAYXMCYI

TXCYZTFIA

QHQYQADZL

DHDVADIHK

ZAWHQEOHA

YFHWYHAIF

FJSNCZFSV

FCRRWMZII

JBTLXCZIS

QRJOGJBOX

ESUWDTREH

CHFXFRHKA

XYXPFNQDG

GHWOSLRKQ

IZOQLHJIP

GKJEAMOUE

PNYXOHQXQ

VMEGPCMHR

OSREWQHEA

BZBGIBBEQ

LIOTLXXHA

BZRDLIUEK

HRAFRRENQ

MNJOQZCZI

ZTIDPPVYH

UPQVXHXTW

NRQPAANWD

QIJLKKKHD

NVNSDQNTM

SJHGSVLXH

BWMBDMPPM

HYOKZMYOL

MUCOJMVYK

FQIXIIOIR

SJBDIEHBK

DJVAPLYLL

ICXCENNGN

VMEJLEXBN

HEYNPOEHO

QOJYQZTUK

EFDMXZYSB

HOQTVORRK

BZOGIBHNU

JCVUXOUFX

NAGBQMWSS

LSBUMVSLO

KRTIUDQGW

QUKZVYHBX

QKZLKXWZJ

XDSRJZSPY

JUMRAWWRR

KOGBNNAZG

IJLQTDCPS

XYXPORIIT

查看完整回答
反对 回复 2021-10-19
  • 1 回答
  • 0 关注
  • 1757 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信