Hi,
I'm experiencing some problem with php code in the article.
On our website there is a page requires login to view. So we build login file to let people sign in view the article. Following code is added in front of that page.
// Check if session is not registered , redirect back to login page.
// Put this code in first line of web page.
[PHP]
session_start();
if(!session_is_registered(username)){
header("location:foldername/login.php");
}
[/PHP]
It appears search engine not working correctly after put these php code in front of article.
The search result always comes up login.php page. If I take these php code off, search engine works fine.
Can anyone help me figure it out what the problem is ?
Thank you very much!
Search engine not working properly
- Oliver Georgi
- Site Admin
- Posts: 9889
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
Re: Search engine not working properly
you should not use this in inline PHP. Remove this.
First enable config setting
Then put that peace of code in the frontend_init.
First enable config setting
Code: Select all
$phpwcms['SESSION_FEinit'] = 1;
Code: Select all
<?php
if(empty($_SESSION['username'])) {
headerRedirect('foldername/login.php');
}
?>