PHP 脚本提前结束
我有一个 php 文件,它可以对用户帐户进行全面的调查。它纯粹用于测试功能是否正常工作。然而,脚本在第一个特征输出之前停止。我已经确定代码在这段代码中的某个地方失败了:
...more above...
Authentication Form<br>
<br>
<?php if($this->session->userdata('authenticated')):?>
Welcome back <?php echo $this->session->userdata('userid');?><br>
<form action="<?php echo base_url();?>/account/logout" method="post">
<input type="submit" value="Log Out"/>
</form>
<?php else:?>
<form action="<?php echo base_url();?>/account/login" method="post">
Username: <input type="text" name="username"/><br>
Password: <input type="text" name="password"/><br>
<input type="submit" value="Login"/>
</form>
<?php endif;?><br>
...more below...
我不明白的是为什么这段代码不执行。没有输出错误,并且我之前使用过与此类似的代码,没有任何问题。任何帮助将不胜感激。
最后一点: 我正在使用在笔记本电脑上运行的 xampp 并使用 codeigniter。两者中最新的。
I have a php file that does a whole sleuth of user account stuff. It's purely being used to test if the features are working. However the script stops before the first feature is output. I have determined that the code is failing somewhere in this code:
...more above...
Authentication Form<br>
<br>
<?php if($this->session->userdata('authenticated')):?>
Welcome back <?php echo $this->session->userdata('userid');?><br>
<form action="<?php echo base_url();?>/account/logout" method="post">
<input type="submit" value="Log Out"/>
</form>
<?php else:?>
<form action="<?php echo base_url();?>/account/login" method="post">
Username: <input type="text" name="username"/><br>
Password: <input type="text" name="password"/><br>
<input type="submit" value="Login"/>
</form>
<?php endif;?><br>
...more below...
What i can not figure out is why this code if not executing. No errors are being outputted and i have used code similar to this before with no problem. Any help would be greatly appreciated.
One last note:
I'm using xampp running on my laptop and using codeigniter. newest of both.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
真正时髦的方法是使用 xdebug http://www.xdebug.org/
蛮力方法可能是将您的文件与
和
plus 结合起来,还请阅读 PHP 手册 @ php.net 中将 error_reporting 设置为适当的级别以进行调试以及 show_errors
The really snazzy way is to use xdebug http://www.xdebug.org/
The brute force way might be to lace your file with
and
plus also read up on setting error_reporting to an appropriate level for debugging plus show_errors in the PHP manual @ php.net