Search output issue after include php

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
stingone
Posts: 25
Joined: Tue Jun 21, 2011 11:31 am

Search output issue after include php

Post by stingone »

Hi

Yesterday i succesfully implemented my security to the mainpage of the faq.

i implemented in line 384 below

//
// Load template files and set template variables
//

Code: Select all

include '../login/dbc.php';
page_protect();
Then i implemented in line 482

Code: Select all

else if ((checkAdmin()) && ($_SESSION['user_id'])) {
   $links_template_vars = array(
        "faqHome"             => $faqconfig->get('main.referenceURL'),
        "msgSearch"           => '<a href="index.php?'.$sids.'action=search">'.$PMF_LANG["msgAdvancedSearch"].'</a>',
        "msgAddContent"       => '<a href="index.php?'.$sids.'action=add">'.$PMF_LANG["msgAddContent"].'</a>',
        "msgQuestion"         => '<a href="index.php?'.$sids.'action=ask">'.$PMF_LANG["msgQuestion"].'</a>',
        "msgOpenQuestions"    => '<a href="index.php?'.$sids.'action=open">'.$PMF_LANG["msgOpenQuestions"].'</a>',
        "msgHelp"             => '<a href="index.php?'.$sids.'action=help">'.$PMF_LANG["msgHelp"].'</a>',
        "msgContact"          => '<a href="index.php?'.$sids.'action=contact">'.$PMF_LANG["msgContact"].'</a>',
        "allCategories"       => '<a href="index.php?'.$sids.'action=show">'.$PMF_LANG["msgShowAllCategories"].'</a>',
        "backToHome"          => '<a href="index.php?'.$sids.'">'.$PMF_LANG["msgHome"].'</a>',
        'showInstantResponse' => '<a href="index.php?'.$sids.'action=instantresponse">'.$PMF_LANG['msgInstantResponse'].'</a>',
        'showSitemap'         => '<a href="index.php?'.$sids.'action=sitemap&lang='.$LANGCODE.'">'.$PMF_LANG['msgSitemap'].'</a>',
		"adminusers"          => '<a href="index.php?action=useradmin">Beheer Gebruikers</a>',
		"adminfaq"            => '<a href="admin/index.php">Beheer FAQ</a>',
		"loguit"              => '<a href="../login/logout.php">Uitloggen</a>',
		"mijnaccount"         => '<a href="index.php?action=mijnaccount">Mijn Account</a>',
        'opensearch'          => $systemUri . 'opensearch.php');
}

else if ($_SESSION['user_id']) {
   $links_template_vars = array(
        "faqHome"             => $faqconfig->get('main.referenceURL'),
        "msgSearch"           => '<a href="index.php?'.$sids.'action=search">'.$PMF_LANG["msgAdvancedSearch"].'</a>',
        "msgAddContent"       => '<a href="index.php?'.$sids.'action=add">'.$PMF_LANG["msgAddContent"].'</a>',
        "msgQuestion"         => '<a href="index.php?'.$sids.'action=ask">'.$PMF_LANG["msgQuestion"].'</a>',
        "msgOpenQuestions"    => '<a href="index.php?'.$sids.'action=open">'.$PMF_LANG["msgOpenQuestions"].'</a>',
        "msgHelp"             => '<a href="index.php?'.$sids.'action=help">'.$PMF_LANG["msgHelp"].'</a>',
        "msgContact"          => '<a href="index.php?'.$sids.'action=contact">'.$PMF_LANG["msgContact"].'</a>',
        "allCategories"       => '<a href="index.php?'.$sids.'action=show">'.$PMF_LANG["msgShowAllCategories"].'</a>',
        "backToHome"          => '<a href="index.php?'.$sids.'">'.$PMF_LANG["msgHome"].'</a>',
        'showInstantResponse' => '<a href="index.php?'.$sids.'action=instantresponse">'.$PMF_LANG['msgInstantResponse'].'</a>',
        'showSitemap'         => '<a href="index.php?'.$sids.'action=sitemap&lang='.$LANGCODE.'">'.$PMF_LANG['msgSitemap'].'</a>',
		"adminusers"          => '',
		"adminfaq"            => '',
		"loguit"              => '<a href="../login/logout.php">Uitloggen</a>',
		"mijnaccount"         => '<a href="index.php?action=mijnaccount">Mijn Account</a>',
        'opensearch'          => $systemUri . 'opensearch.php');
}
Everything works fine and the links are shown correctly.

But when i click on the search button it gives me a white page and does nothing, and when i try to login to the admin section it rederects me to the login part of the admin section :cry: its the last step to complete this all

Code: Select all

faq/?searchcategory=%25&action=search&search=&submit=Zoeken
stingone
Posts: 25
Joined: Tue Jun 21, 2011 11:31 am

Re: Search output issue after include php

Post by stingone »

It all happens when i including a php file in the index.php. when deleting the include it works just fine.

How can ik solve this problem?
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Search output issue after include php

Post by Thorsten »

Hi,

if you get a white page, a PHP fatal error occurs. Please check your error log.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
stingone
Posts: 25
Joined: Tue Jun 21, 2011 11:31 am

Re: Search output issue after include php

Post by stingone »

Thorsten wrote:Hi,

if you get a white page, a PHP fatal error occurs. Please check your error log.

bye
Thorsten
Hi Thorsten, thank for your repley. This it was i get when debug mode on.

Code: Select all

phpMyFAQ warning [2]: ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time in /public_html/faq/inc/Init.php on line 113

phpMyFAQ notice [8]: A session had already been started - ignoring session_start() in /public_html/login/dbc.php on line 64

phpMyFAQ warning [2]: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /public_html/login/dbc.php on line 98

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at /home/jjlast/domains/c-estimate.nl/public_html/faq/inc/functions.php:150) in /public_html/faq/inc/Session.php on line 388
How can ik resolve this?
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Search output issue after include php

Post by Thorsten »

Hi,

you cannot solve this except removing your code or rewrite the session management of phpMyFAQ. You want to use 2 sessions within phpMyFAQ. This can't work.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Cookie
Posts: 2
Joined: Fri Jun 29, 2012 5:09 pm

Re: Search output issue after include php

Post by Cookie »

Thorsten wrote:Hi,

you cannot solve this except removing your code or rewrite the session management of phpMyFAQ. You want to use 2 sessions within phpMyFAQ. This can't work.

bye
Thorsten
Thats unfortunatelly a pitty because I tried the same :( Is there any possibility that itll work some day?
Gotta go back in time
Post Reply