why <?php tag is closing on $user -> [closed]

余生长醉 提交于 2019-12-02 09:10:10

Short Version: It's not. PHP terminates at ?> (or possibly %> if you're using asp style tags).

Long Version: Take a look through your document, try placing various echo statements around to ensure you're exiting where you think you are. Edit the file with a plain text viewer if you can, to make sure your editor isn't hiding anything from you.

Update Ensure that your include is performing correctly. If it's unable to find that file, or the file doesn't create the user object, your next line will fail, and PHP will terminate.

Yep, it's the spaces:

//replace
$user -> session_begin();

//with
$user->session_begin();

and all other places where -> is a space.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!