duanliu8998 2017-04-06 14:59
浏览 39
已采纳

模板文件中的未定义变量[关闭]

I am new here, so please bear with me.

Am trying to run a project built using the codeigniter.

The project is an online registration system,but am getting the undefined variable error in some parts of my page.

Please if you got the time to go over the project and help me out I will be very grateful.

Here is the link to the whole system.

NB:It contains the exported database already( the database is called 'orsdb' )

Cheers!!!

https://drive.google.com/open?id=0ByYO-aax6KH3cnJNRnBsNEgwd1k

  • 写回答

1条回答 默认 最新

  • dopa53272 2017-04-06 16:16
    关注

    You should check every variable in your CI view part before printing it, you can use isset() to check you variable is either define or not. Example -

    <?php echo isset($var) ? $var:""; ?> You can also use empty() function to check variables.

    Another thing is if your variable is always undefined then you must check your array which contains data fetching from database in CI controller and print the array to check your all required value does exist or not. If not exists then check your SQL query whether it fetches your required data or not.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

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