Category Archive for: When Things Go Wrong (and They Will)

Simplifying and Abstracting Your Code

Are you done yet? Well, almost. The error printing is great. but take another look at the code in your main script, connectino.php: That’s a lot of code to handle the problem. In fact. you have a good bit more code dealing with the error than you do dealing with things that go right. That’s not always a…

Read More →

Redirecting On Error

You now have a complex mechanism in place to deal with error messages as they crop up, and you even have a way of printing out errors for your programming edification (with debug_print). Now, it’s time to see how to use the error information. Take a look at one of your simplest page/script combinations: connection.html and connect_php. Update…

Read More →

Add Debugging to Your Application

You’ve got some error pages that are very helpful to your readers. But what about you? Certainly, you’re going to need to use your system, too. Although you want to have error pages that don’t scare off your users, there are times when you need to figure out what’s going on, not just in your code, but also…

Read More →

Welcome to Security and Phishing

And now, welcome to a big, fat, ugly problem. The way your page is set up at this juncture, anyone with a bit of programming prowess could supply his own error message to your web page, simply by adding it to any URL that points to your application: .?error_message. That’s one way to employ a technique of Internet vandalism…

Read More →

Finding a Middle Ground for Error Pages with PHP

On one hand, you want pages that are dead simple: some text, an image or two, and static content. Nothing can go wrong, which means your users get some level of reassurance and comfort. On the other hand, the error page in Figure 8-5 is awfully generic. It just doesn’t S -I/very much. It would be nice to…

Read More →

Planning Your Error Pages

When you were creating the page that shows user profiles (page 196), you began with HTML. You created a mock-up of a simple page and then added PHP as you needed it. There’s no reason to abandon that approach here, because you’re basically trying to do the same thing. You want a nice-looking page for displaying errors, so before…

Read More →

When Things Go Wrong (and They Will)

You have a growing set of functional scripts. You have some web pages that interact with them, CSS to style both your HTML static pages and the HTML that your scripts dish out, and you could (and should) go in and add some client-side Java5cript validation. Things are looking pretty good. But there’s a monster lurking in…

Read More →

Back to Top