Forum Moderators: coopster

Message Too Old, No Replies

headers_sent info

getting rid of those warnings!

         

ahmedtheking

12:19 am on May 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm trying to get rid of this:

Warning: LDAP: Unable to bind to server: Invalid credentials in /home/.sites/148/site16/web/inc/templates/1/roaarchive_ldapauth.inc.php on line 49

Ive tried adding headers_sent, but it does not get rid of it! Is there any other way?

anshul

6:38 am on May 13, 2005 (gmt 0)

10+ Year Member



Check, if this helps:
<?php ob_start()?>
<?php <html>your_script_plus_html_stuff</html>?>
<?php ob_end_flush();?>

ahmedtheking

10:54 am on May 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope, doesn't work!

Stormfx

3:59 pm on May 13, 2005 (gmt 0)

10+ Year Member



You'll need to post some code. We have no idea what's going with just the error. Lots of things can cause errors :)

ahmedtheking

5:44 pm on May 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, Ill get back to you guys soon! Thanks!

ahmedtheking

7:10 pm on May 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, the way my site works:
main.php is the main php doc, as you can tell!

I run an ldap auth script that sits 2 layers down from it (main.php > archiveindex.php > ldapauth.php)

If someone enters a wrong password, i get that header passed.

Is there any way of stopping the headers being displayed, and display a custom error?

Stormfx

9:04 pm on May 13, 2005 (gmt 0)

10+ Year Member



Sure, you can customize the ldap script itself. And check to see if a error has occurred. Or, as an alternative, change your error_reporting setting. Right now you're PHP is configured to display at least warnings. A last option is to put an @ before the function call.

If you're calling the functions in your main page from the ldap page, why not do something like:

<?php

if (!@ldap_function()) {
// header('Location: [yoursite.com...]
// echo 'We're sorry, there was an error';
}
?>

Or something. I use @ in my database classes to muffle warnings etc when I'm testing.