Hello There, Guest! › Register

Hide Content 1.4 released.
Looking for a custom plugin for your site? Ask here for a quote.

Turn off php warnings for individual pages?
#1

I'm not sure why,  but one of my custom pages is sending me a:  

the followings warnings occurred message.

Its a: Warning [2] cannot modify header information- headers already sent warning.

It only occurs for guests Huh Huh  ( which I have denied access to the page) I have other users that are denied access, but for those groups the access denied displays correctly( no php warning)

2 questions

1) any ideas why?
2) is there a way to turn off the warnings on the individual page.


Quote:[PHP]                                          errorHandler->error

/inc/functions.php        1649         header

/inc/class_session.php
    348        my_setcookie
/inc/class_session.php     98         session->load_guest
/global.php                     55          session->init
Reply
#2

Hi,

I don't know which page it is. Anyway, if you're modifying pages with the Windows Notepad, you'll likely have problems like this.

Regards,
Diogo
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#3

using notepad++

making my own custom pages



PHP Code:
<?php 

$templatelist 
'BookDB7';
define('IN_MYBB'1); require "./global.php";

add_breadcrumb("BookDB7""BookDB7.php"); 

eval(
"\$html = \"".$templates->get("BookDB7")."\";"); 

if(
in_array($mybb->user['usergroup'], array('1','89','120','157')))
{
error("Access denied");


output_page($html);

?>
this is the code for the page

but is there a way just to turn off the warnings for this page?
Reply
#4

Hmm you have "PHP Code:" before <?php

Regarding individual page configuration, I don't think it's possible.

It would still be nice to see a screenshot otherwise it's hard to understand when the warning happens and why.
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#5

I will try to post a screen shot when I get a chance.

That" Php code" is a copy error, I corrected it above.
Reply
#6

I figured it out. Not sure why but, your first assessment was correct. It was a linebreak or whitespace issue.
I compressed the code to 1 line in an editor and it fixed it on the new upload.

what editor are you using to make sure this does not happen to you?
Reply
#7

I use Notepad++ Smile At some point you might have opened it with another editor probably or copy/pasted something, I have no idea.
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#8

(12-23-2017, 05:05 AM)Diogo Parrinha Wrote: I use Notepad++ Smile At some point you might have opened it with another editor probably or copy/pasted something, I have no idea.

Thanks for pointing me in the right direction Wink
Reply




Users browsing this thread: 1 Guest(s)