PHP script ending prematurely
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">
<inp开发者_StackOverflow中文版ut 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.
The really snazzy way is to use xdebug http://www.xdebug.org/
The brute force way might be to lace your file with
echo __FILE__, ":", __LINE__, "\n<br/>";
and
var_dump(get_defined_vars());
plus also read up on setting error_reporting to an appropriate level for debugging plus show_errors in the PHP manual @ php.net
精彩评论