Advice on Error Handling ...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmueller0823
Forum Commoner
Posts: 37
Joined: Tue Apr 20, 2004 9:06 pm

Advice on Error Handling ...

Post by jmueller0823 »

We utilize several Includes which output
results from a MySQL script.

The Includes look like this:

Code: Select all

<? include "http://www.site.com/php/psDynamic/psDynamic.php?command=view&cid=89" ; ?>
This code is trouble-free until we encounter the occasional SQL error.
If an error occurs, (obviously) a MySQL error displays and screws up the screen.

What I'd like to do is add some error handling.

Something like...
  • Try the Include
  • If result contains text 'failed' or '503', then do not display, then exit.
  • Display Include
Is this possible?
Thanks!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Security recommendation: do not ever EVER EVER include a remote file.
Post Reply