[thelist] PHP's include() function

David Bindel dbindel at austin.rr.com
Wed May 29 15:27:01 CDT 2002


Let me explain my problem:

I *would be* using PHP's include() function to include a
header and footer on every page of my website, and since my
site implements database connections on some pages, I use
code similar to the following:

mysql_select_db("my_db") or die("<p>Could not select
database.</p>");

In using the die() function, it displays the message inside
of it and stops all PHP processing instead of displaying a
really ugly, unprofessional PHP error.

But since that die() function has stopped the PHP
processing, my footer file is not included at the bottom of
the page like I need it to be.

There must be some kind of workaround or alternate function
to die() or exit().  I'm sure someone else has had this
problem in the past... could you please help me?

Thanks in advance!

David Bindel




More information about the thelist mailing list