开发者

Smarty and PHP sessions

Im using Smarty and PHP to create a simple blog-like CMS. The problem i'm having is that i can't seem to be able to start a session.

I have an init.php file with the following:

<?php
 session_start();

 // Mudar a path do PHP para podermos fazer include das 
 // bibliotecas mais facilmente


 set_include_path(".:./lib");

 // Fazer include do MDB2

 require_once ('MDB2.php');
    (...)
    require_once("Smarty.cl开发者_开发技巧ass.php");

    $smarty = new Smarty;

which is called in every file like this:

<?php
 require_once("common/init.php");

but whenever i try to retrieve session parameters it fails, so i assume the session is not starting correctly. Any hints???


at first you can create function link init and call that function, but your way isn't bad. and must be work. (see frameworks...) complete your question with errors

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜