WebSite X5Help Center

 
David A.
David A.
User

Session in the Header  en

Auteur : David A.
Visité 1479, Followers 1, Partagé 0  
Mots-clés :: header,php,session,x5

I'm working with X5, PHP and MYSQL.  Well, I created a members area using php and session scripts to make sure each user is logged in before going to other areas of the site.  To do this, the SESSSION function needs to be the FIRST line in the php page.  The only thing X5 allows me to do is put it in there "before the header closes" in the advance settings.  However, this is no good because everytime I "export" the site, X5 creates metadata and CSS syle sheets that go before my custom <?php SESSION?> function.  It is such a pain for me to go into each PHP file and manually move the session data to the top of the page, everytime I export the site.  It's getting old quick.  EIther can someone help me think of another way to do this (without using X5's access managemnt feature), or X5, please address this in an update ASAP!!  You're killing me.


Thanks!

Dave

Posté le
3 RéPONSES
Incomedia
Claudio D.
Incomedia

Hello David,

If you choose the option "Before CLosing the HTML Tag" then the code will be added as first line of the file before the <html> tag starts.

The code added will only be visible in the file once exported and in the preview it will not show up.

Please feel free to write back if you need more information.

Lire plus
Posté le de Claudio D.
David A.
David A.
User
Auteur

Thanks for the advice, I believe the session data needs to be the first line in the code, and putting it before the HTML tag starts doesn't accomplish that.

Lire plus
Posté le de David A.
Incomedia
Claudio D.
Incomedia

Hello David,

In this way the code will be in the first line. This option has been added for these cases.

Many thanks!

Lire plus
Posté le de Claudio D.