XDebug’s settings reminded me - no output to the browser if sending headers

May 20th, 2008 by Aaron

So, I admit it - I’ve become lazy. Well, in all fairness, the programmer before me at “the triangle” was also lazy. And after messing with XDebug and setting output_buffering to off and implicit flush to on… I was reminded of our laziness.

Because of these changes, some of the spaces that we had in our code are now sending output directly to the browser (even though we have an output handler…). For example, this is bad code:

1
2
3
4
5
/** and some more fun here**/
?>
 
<?php
/** start second block of code **/

I know it is bad - you know it is bad… *sigh*. But because of this, I’m not able to use Xdebug’s debugging feature on my ‘triangle’ code. I’d have to put through a project to REMOVE SPACES. Hah.


XDebug and Eclipse PDT on Windows - From Start to Finish

May 20th, 2008 by Aaron

XDebug and Eclipse PDT on Windows - From Start to Finish

With our recent upgrade to php at “the triangle,” I felt it was time to start working on using a debugging and code profiling tool. When I say felt like it was time… I meant our PHP version finally supported it. *sigh*. Anyway, from start to finish, this is what I did in order to get Xdebug to integrate into my current eclipse PDT - as well as investigate the other features of xdebug. I tried to detail all of the mistakes I made as well as what I figured out. Let’s go:

Continue reading XDebug and Eclipse PDT on Windows - From Start to Finish


Timetracker Timeclock

May 12th, 2008 by Aaron

The 102 Degrees Timeclock software package is a very simple interface for keeping track of time. Instead of purchasing a timeclock, you could resurrect an old laptop and run this software on it. With a very simple clean interface, even beginning computer users will feel comfortable. The timeclock has .csv generation for reporting - which can easily be opened in Microsoft Excel. The entire interface is web based.

The software requires PHP5 with MySQL.

You can download it here:
timetracker - timeclock 0.1

Installation Instructions
After you upload the contents of the zip file to the root of your website (in future releases, I’ll make it be available to any folder..), you can visit your website’s domain. This will launch the install script.

The script will ask for MySQL credentials. You need to have a hostname, user and password, and a database for the software to write to.

Finally, after you submit it and receive a successful message, delete the install.php file.

Then, visit your domain again, and you’re good to go - or follow the directions on the screen to set up your users.


Why are there different web browsers?

May 11th, 2008 by Aaron

In the same way that not everyone drives a Honda, we find that we have different web browsers. For the beginner to the Internet, this might come as a surprise. Normally, they are only used to the default browser on their computer. For example, Windows users are familiar with Internet Explorer. Mac users might be familiar with Safari.

In the same way that car companies each have their strengths and weaknesses, web browsers have the same. Each one isn’t the same – they have different features – and even interpret the screen and content differently. It is possible for one browser to display CSS different than another one. Because of this, your website may not always look the exact same in each browser. Considerable care can be taken to make sure that most of the site looks the same on most browsers. You might use automobile road design as an example. The incline of a driveway may be fine for most cars, like the Honda, but a Ferrari might rub its front end entering the driveway. Generally, it’s acceptable to develop towards the majority – and hope for the best for the minority.

I don’t want to bore you with the history of browsers, where the big players came from and why. Let’s just compare the 4 main ones to get an idea of what’s out there.

Internet Explorer – Microsoft
Microsoft installs Internet Explorer by default with every version of Windows. Since most PCs have Windows, most users are familiar with Internet Explorer – it’s their first way onto the internet. Since Microsoft owns Windows and Internet Explorer, and installs them together, Internet Explorer is very integrated with Windows. There have been security issues because of this integration in the past. Internet Explorer was also available for Mac for a period of time. Finally, Microsoft tried to exercise its market dominance by creating their own standards and generating their own interpretation of CSS, JS and HTML. Because of this, Internet Explorer sometimes generates web pages out of compliance with the standards that were built for HTML, CSS and JS. I generally recommend against using Internet Explorer – especially for the casual web surfer who isn’t as familiar with their computer.

FireFox – Mozilla
FireFox is an open source browser with roots from the Mozilla corporation (Think ‘netscape’). FireFox has versions of itself available for many different operating systems, including Windows, Linux and Mac. Generally, FireFox has been more secure than Internet Explorer because of its separation from the operating system as well as its open source available for audit. This may not always be the case, however. Also, FireFox tends to be more rigid to standards and renders HTML, CSS and JS more accurately than Internet Explorer. I recommend FireFox for the casual surfer because of its security features. Advanced surfers may also appreciate its plugin based system where they can add extra features to their browser easily.

Safari – Macintosh
In the same way that Internet Explorer was a default for Windows, Safari is the default for Mac. Safari always seemed to be behind when it came to supporting features of the internet and sticking with standards, but that seems to be less the case lately. Additionally, Safari is now available for other platforms like Windows.

Opera
With roots as the third party browser with both professional and free-ad-supported versions, Opera has always been a unique feature promoter. Opera’s support of standards is growing stronger each release – keep an eye out to watch for the newest versions of Opera – and their expansion to mobile devices.


What Does This Mean To Me?

Your web site firm should determine which may be the primary 2 browsers visitors will use to visit your website. For example, if you’re a non-technical site, you can probably bet on Internet Explorer first, then perhaps FireFox. If you’re a website about digital video editing equipment, you can probably bet a lot of Macs with Safari will be visiting, as well as FireFox. If you’re a technical research site, you might find that FireFox followed by Opera are your most common visitors. With this in mind, your firm should test the design, layout and functionality with at least those two browsers. Any additional testing is a plus. You may not choose to test with both browsers – but you should ask for the results of their testing with those browsers. Any irregularities should be noted. They may not make a lot of sense to ‘change,’ but it is something you should be aware of. Do not accept responses like “This just won’t work in FireFox” if it is one of your targeted browsers. Instead, ask what can be done to provide a consistent experience.

102 Degrees always tests with Internet Explorer and FireFox. When we determine that additional browsers might be used more frequently, we’ll test with those as well.


What do all of those acronyms mean?

May 11th, 2008 by Aaron

Whether you’re looking at web hosting advertisements or speaking with an internet firm, you’re going to run into various acronyms. If you’re not familiar with the industry, this can get confusing. Let’s check out the main ones to see what they really mean to you.

HTML – HyperText Markup Language – HTML is the way that web pages determine what content means on them. You can think of it like a template. For example, if something needs to be emphasized on the page, a specific HTML template item marks it to show emphasized. HTML itself does not do anything programmatic or exciting – it is simply used to organize your content.

CSS – Cascading Style Sheets – CSS is the language that refers to the way information that has been marked up by HTML is presented to the browser. So, if HTML has marked something to be emphasized, what should emphasize look like? Should it be bold? How about italicized? CSS can transform all of the HTML markings to be presentable. If it weren’t for CSS, all of your information would simply run together in one size on one line.

JS – JavaScript – JS or JavaScript is the way that actions happen immediately in the browser. For example, if you click a plus sign to the left of an item, and more content shows up almost immediately, it was because of JavaScript. JavaScript is a programming language that can manipulate both HTML and CSS. For example, HTML could have a marked spot for the visitor’s zip code. When the page loads, no one knows where the visitor is, however. JavaScript can be programmed to ask the visitor for their zipcode, and then fill that value into the marked up spot immediately. It could also turn the zipcode red by modifying the CSS.

PHP – PHP: Hypertext Processor – (PHP is a recursive acronym) – PHP is the language that resides on the web host for processing data and doing actions. For example, if you visit a web page that has a contact form, the form sends the data to PHP. PHP then determines what to do with that data. It might send an e-mail to someone and then generate a new page. PHP can generate HTML (and CSS and JS too…) and send it back to the browser to be viewed by you. PHP has to be installed on the web hosting server by an administrator. Many web hosts have this installed already. PHP is an open source project created by a technical community online. This means it is also free to install and use.

FTP – File Transfer Protocol – To remotely connect to a web hosting server, a specific type of connection of the internet is created. This is called an FTP connection. This allows the developer to upload content to the server directly. Because this is connecting one computer to another, there has to be security measures in place. Normally, a developer will ask you for your FTP address (which means – which computer should I be connecting to?), your FTP username (which is to say, which account should I be using on this web host) and your FTP password (the secret way you identify that you are the owner of the FTP account).

MySQL – My Structured Query Language – MySQL is an open source database system. A database is a type of software that stores data on the server. This data is retrieved by various programming languages like PHP or ASP. When dealing with inventory, forums or other dynamic catalogs of information, a database is needed. As with PHP, this has to be installed on a web hosting server. Many web hosts have this installed already. Because of the security of data that is most often needed, MySQL usually requires credentials just like FTP does.

ASP – Active Server Pages – ASP is similar to PHP. ASP is owned by Microsoft and requires special licensing to install on the server with associated fees. Most things that can be done in ASP can be done in PHP – and vice versa.

Linux – Not an acronym – Linux is the name of the operating system that can be used on a web server. Linux is open source – and most versions are free to use and install. Another common operating system for web servers can be Windows – but is usually a slightly different flavor than that which is on a PC.

Apache – Not an acronym – Apache is the name of the software that instructs the web server how to send page content back to the internet and your browser. Apache is normally bundled with Linux based servers – and is open source. Generally, Apache and PHP work together well.

IIS – Internet Information Services – IIS is the name of the software used on Microsoft based web servers to send page content back to the internet. IIS has specific licensing and possible associated fees. Generally, IIS and ASP work together well.


What do I need to get a website?

May 11th, 2008 by Aaron

This article covers the basics of what you need to know to get your business on the Internet fast and successfully.

You Have a Need and Have Ideas to be Successful
With very little exception, companies are only successful with internet presence if they have a real need to be online. If you make a personal website about yourself, you can only expect a few of your close friends to visit it. If you have a company and think you need a website, you must have a need to be online.

Do you have products that you want to sell online?
Do you have a portfolio that you can showcase on your website?
Do you have a clear call to action?

Think about visiting your website as a potential customer – take away the ownership of the products and business you have and look at it objectively. What do you have to offer online? Why would you visit this website? Think about other websites that you have visited looking for product information. Which ones were successful enough to make you book mark the page or generate a sales lead from you?

Make sure to have a need for your website. If you don’t have a clear goal, there is no way to measure success – and your investment could be a waste.

Now that you’ve determined that you have the need to be online, how are you going to present that need to your visitors? What ideas can you convey to get your visitors to understand the legitimacy of your need?

Come up with all kinds of ideas – the more the better. This is VERY IMPORTANT: If you’ve never seen it done online, do NOT rule it out. List it as your idea. This could make your website breakthrough and different! Don’t expect your website creation firm to know everything about your product – it is your idea that they are here to help you build. Go wild.

Focus On a Realistic Timeline and Budget
I have to interject this here just to take back the reigns. Remember, although you can pump out a million ideas, only a few are those are cream of the crop that you want to put into your website. While you may not know the timeline and charges that your website creation firm may charge, brace yourself for hearing the real-life estimates and timelines.

When working with your firm, expect them to give you the hard news – feature A may take 3 months to develop and cost $20,000. Can you accept this? This is where you have to start deciding which parts are important to fit into your budget and timeframe. Don’t become discouraged, however! Keep a list of your ideas. You never know when you’ll have the chance to revisit and add new functionality to your site.

Have Information – Your Firm May Not be Experts at Your Field
Unless you’ve specifically contracted a firm that says they will develop all of the copy, pictures and data for your website, you can assume that they’re going to expect this information from you.

Creating a website requires both a monetary and time commitment from you. You will need to provide the technical details, wording and pictures/content of your website. You can rely on your firm to present this information in a clean, attractive, consistent manner – but they may be working at this in a far more algebraic manner than you may realize. One day, the firm may be working with an auto-body shop, the next day with a ceramics manufacturer. You can’t expect them to be experts at each topic. Finally, even after the firm has completed the website, it will be your responsibility to review it and make sure it meets your expectations.

Designer or Programmer or Both?
After having your ideas together, and gathering some initial content, it is time to find a firm to do your work. As with any industry, there are entry level technicians to highly skilled professionals. It is important to know what type of firm you need to accurately put your ideas into practice while sticking to a budget.

Web Designers can usually make a graphically appealing simple website. They may make a few pages, resize images, create logos, etc.

Web Programmers are those who can do the nuts and bolts of creating contact forms, forums, blogs, maps, interactive services, etc. Traditionally, web programmers have been known not to have the best artistic design sense.

Finally, a hybrid exists: Web Developer. This term generally is used to encompass a professional who can do both design work and programming.

With this in mind, if you’re making a simple website with a few pages, you may want to pick a designer. If you have a contact form or something simple like that, they might contract with another programmer to do the work for them. If you’re looking for a fully featured website, with many bits of interactivity, concise and attractive information presentation, and high impact, you’ll want to contract a developer.

You don’t need to ask them what their ‘label’ is – you will be able to determine this from their work portfolio for tips on what kind of professional they are. If all else fails, present them with your requirements and see if they can make it happen. Remember, if you don’t feel comfortable with them, move on.

Web Hosting
While I get into the specifics of web hosting more here in this article, I’ll cover the main idea here.

You need web hosting. Web hosting is space on a computer that is always on with a fast internet connection. This is the computer that stores your website. Prices for hosting can vary depending on the company and features of the hosting. You do not need to purchase the hosting from the firm you contract for your website. However, your site may have specific technology requirements, so not just any offering may suffice. Generally, you can purchase hosting from the firm you’re working with for your site, however, to make everything seamless. This is usually a monthly or yearly reoccurring charge. Make sure to build this initial charge or setup fee into your budget.

The last important thing to find out from your provider is the information required to access this service yourself – especially if you’re using the same provider as the firm contracted to design your site. You will need this information just in case you ever decide to move your site to a different host or hire a different firm.

Domain Name
I give more detail on what a domain name is in this article. However, here is the main idea.

You need a domain name to point to your web hosting. A domain name is those familiar www dot something dot com labels. You can have a .com, .net, .org, etc, domain name – there are a lot to pick from. This usually is an annual reoccurring charge. Some web hosting providers throw in the domain name for free.

The important thing to find out from your provider is how to access the domain name yourself to make changes. You (or your next provider) may need access to it if you design to switch services.

Search Engine Optimization and Submission: the Truth
When organizing and presenting your information, your firm may request a few different wording changes to your content. This might be used to boost the chance that a search engine, like www.google.com, might find your website or list it higher on the page. Overall, if you have quality content, there should be only tweaks to the actual design of the page – not complete rewrites of information.

If the firm promises to get your website on the front page of a search engine – or get you a top 10 listing – run away! There is no legitimate way to guarantee search engine placement. They may be practicing questionable tactics for search engine placement and optimization which could lead to penalties for your website.

Search engine submission services are not needed. With the advanced technology of search engines currently, one link from someone is all you’ll need. Years ago, these services may have been needed, but today they might even hurt your chances of being listed as a high quality link in the top search engines.

Update Plan for your website
As your business changes, so might your products, portfolio, etc. You have two options to keep your website up to date. You could request a self-service website (commonly referred to as a “Content Management System” or “CMS”) or you could hire someone to make your changes when applicable. There are pros and cons to each solution.

When using a CMS, the initial development investment may be much higher. You may also be required to invest more time initially learning the system, adding content, and formatting your words and pictures. With a system like this, however, you are put into control of your website – you can make changes to it 24×7 – whenever you want to.

If you hire a firm to update your website, the initial roll-out costs are probably lower. If you like the firm you worked with for the initial deployment, discuss an update contract with them. They may cut you a deal on future changes to your website. If you did not like them, all is not lost. You may move onto another firm and they can make the changes. Keep in mind, a new firm may need some ramp-up time to get familiar with the website. They will also need the information for your web hosting to access your files.

It is important to have an update plan for your website. Once your website starts lagging behind your business, your successful leads will dramatically drop. You might also garner ill will from visitors who find out that the product representation on the internet is not accurate.

Last But Not Least, How Much is this Going to Cost? What is the timeline?
That’s the million dollar question – or at least you hope it isn’t!!

Don’t be afraid to ask for the cost of the project. Understand that there might be actual cost versus estimated costs. Ask the firm you’re working for how they plan to update you if the cost changes. Also, remember that some firms, especially smaller free-lance ones, require a down payment first.

Cost may vary between firms. You may shop around – but it is my experience that you won’t find a lot of bargaining and price lowering from web developers in particular. It is important to ask for reasons for the price difference – but then judge by their response as well as by their actual words whether you believe the price difference to be acceptable and reflect quality and services.

You may find that you will be quoted a certain number of hours at a specific amount per hour. For example, you may be quoted 20 hours at $100 an hour. Initially, this may sound like a very scary amount. It is important that you discuss with the firm what is all covered in that 20 hours, what happens if they’re under estimate or over budget, etc.

Scheduling 20 hours may be different than what you’re used to. You need to request a due date from the firm. Just because they quote 20 hours doesn’t mean they’ll be working on it for 3 days straight. You might find that they can fit your work in at five four hour blocks over 2 weeks. This is why it is important to discuss the actual due date of the project, and not just the billable estimate in hours.

There is no right answer for the final price. For the most part, one would hope that you get what you pay for. Be wary of an estimate that is drastically lower than anyone else’s. Also, if you receive an estimate that is drastically higher than anyone else’s, make sure that that firm understands the project requirements and your budget. It also could be that they just might not be able to make it work.

With All of this Information, How Do I Proceed?
First of all, check out the first few steps again. Make sure that you have your idea and need set, and determine if you have enough information to begin. Your firm may not be able to help you determine all of your needs because their expertise is internet service – not your business.

Next, contact your providers/firms of choice. Be completely honest. Say what you’ve done so far, what you need help with, etc. If a firm refuses to provide assistance with your initial planning, it doesn’t look like they’d be one to continue your project with. Politely remember that the more information you request from a firm to flesh out the details of your project, the more they’re expecting to work with you from start to finish. Don’t be surprised if they’re very reluctant to help you again if you request a lot of information and start planning with them – and then don’t choose them. It is not personal; it is just time investment from a business perspective.

So it looks like you’ve got your bullet points of what you need to know to get your business online. From here, it’s up to you. As always, if you’re looking for a firm to handle your project, visit the contact link on the 102 Degrees website!


What is Website Hosting?

May 11th, 2008 by Aaron

What is website hosting and why do you need it? Those are two very important questions.

Web Sites are Hosted on Computers
Every website resides on a computer somewhere. This is where the term hosting comes from – because these computers host the website.

These usually are special types of computers in specific configurations to host websites. They may not have the same operating system you’re used to (like Windows, for example), may have different parts, might not even have monitors and keyboards!

They usually are in a data center that has back up power in case the power goes out in that location. They’re also connected to the internet via super-fast internet connections that are always connected and available.

These computers usually have a specific method of connecting to them remotely so that files can be added to be part of your website. This way, it is not necessary for your web firm to be physically in front of the computer they’re working with for you.

What Types of Website Hosting are Available?
Because of the various different configuration options and quality of service, there are many different options when choosing website hosting.

Physically, these computers are usually pretty big and powerful generally. Because of that, they can provide service for more sites than just yours. This is called shared hosting.

For very busy websites or ones with very specific configuration options, dedicated servers are available. This usually is a computer that hosts only your website for a much higher fee. There are generally more opportunities to customize this type of server. For most users, this is overkill.

There are also free web services, but they usually have advertisements, are slow, could be insecure, or are for special interest websites only. Some don’t allow domain names to point to the website and instead require you to use theirs. Unless you’re just testing out an idea yourself, I would suggest against acquiring free hosting.

Along with different types of hosting, there are different services for each type. Some may be suitable for hosting HTML only pages. Some might allow for dynamic programming including PHP or MySQL. (For more help on these acronyms, check out this article here.) Depending on the extra services offered, the fee may be different for each hosting solution.

Why Can’t I Host it Myself? Why do I Need to Buy This?
Technically, depending on your internet service provider, you could host your own website. You could purchase a web server, or even use your home computer. However, there are a bunch of reasons why you should buy service instead of trying to host it yourself.

It may be against your Internet Service Provider’s terms of service to provide a hosting service on your internet connection. They do this for both quality of service and security reasons.

Your connection probably is not fast enough or might not always be on. Your internet connection may seem blazingly fast for you, but imagine 10 or 20 of you using the same connection? This is what would happen if you served your own website. All that traffic could slow down your connection. Web hosts have drastically larger capacities.

Your computer would always have to be on. Do you have a gas generator? Do you have an additional computer that you can just leave on all the time? All of this is handled by the host.

Are you a computer administrator? Do you know about all the various security holes and compromises? In the same way that personal computers have threats from viruses, servers have different threats. Since these computers are always on and usually unmanned, keeping up with all of these changes can easily get out of control – unless you’re a skilled admin.

You do need to have website hosting for your website. Once you know the requirements of your website, your firm should be able to help you acquire hosting. Fees may vary – and it is OK to shop around. However, as always, fees sometimes do correlate to the level of quality (you’d hate to purchase web hosting and then find out that the webhost goes down and offline often!).

If you’re working on a project with 102 Degrees, we can offer hosting for you.


What is a Domain Name?

May 11th, 2008 by Aaron

What is a domain name or a dot com name? And why are they needed? Let’s find out.

What is a Domain Name?
A domain name is a pointer to a website. Whenever you hear someone say www.yahoo.com or www.google.com, they’re referring to the domain name of that website. Domain names are controlled by an official registry which allows websites to purchase the right to use that name, reserve it, and point it to a specific website.

Certain companies, called Registrars, provide the interface to this registry. These companies are licensed to provide this service – which is sometimes bundled with additional services. Prices can range from $9 to $35 annually, depending on the company providing the domain name and the extra services they might provide.

Why are they needed?
Every computer on the internet has a numeric address assigned to it. It is far easier to remember the name and type http://www.yahoo.com instead of typing the equivalent http://69.147.76.15. Also, depending on the type of web hosting, many websites can be served from the same computer with one numeric address. Because of this, multiple domain names are assigned – one to represent each individual website at that numeric address.

What are the restrictions and types?
The most common domain name ends with ‘.com.’ You might also be familiar with .net, .org, .co.uk, .info, .biz – the list goes on and on. The domain name has to be 255 characters or less. There are other restrictions on certain domain names – such as .gov has to be a verified government entity. Finally, they can only contain certain special non-alphanumeric characters. Generally speaking, most people with commercial business entities online choose .com (dot com for commercial). Others may also choose .net. Organizations and non profits tend to choose .org. The .com is the most popular domain name type.

Do I Own the Domain Name?
When you purchase registration of a domain name through a registrar, make sure that they register the domain name in your name. This generally happens now, but in the past this was sometimes not the case. Once you’re listed as the administrative contact, you have the ability to modify – with the registrar’s help – any of the settings on your domain name including which computer the address points to. Technically, you do not OWN the domain name – it’s more of a lease. For the most part, domain names fall under trademark and copyright laws – so if you have a registered business, you should have no problem hanging on to your domain name for as long as you want it.

What Should I Keep in Mind When Choosing a Domain Name?
Domain names are on a first come – first serve basis. It may make sense to register your domain name as soon as possible – even if your website is not available. This should guarantee that no one else can register your domain name, potentially disrupting the design process of your website.

Generally, a shorter name is better. Try not to use contractions or hard to spell words. Too many acronyms, especially if it is not common in your industry can be confusing.

Lets see an example. Your company name is XYZ Stairs and Doors. Your target market is North Eastern Wisconsin.
xyz.com – awesome – probably taken because it is so small – but would be easy to remember.
xyzstairsanddoors.com – the full company name. Highly targeted.
xyzstairsndoors.com – users might type in ‘and’ instead of ‘n’
newstairsanddoors.com – North Eastern Wisconsin is commonly abbreviated as NEW – so this is targeted.
northeasternwisconsinstairsanddoors.com – not good – too long – doesn’t say much about your company – but is targeted.
qualityentrances.com – interesting idea. May work better with creative companies, but not so well with technical/industrial companies.

What to Do Next?
If you have a business name and are getting your website ready, you may ask your firm to investigate into your options for domain names. You might also ask them for specific ones – and they can do research for you. You might want to pay up front for the domain registration so that they can register it immediately for you. You may also suggest they register alternate spellings of your domain name. It is not necessary to get all the different types of domain names for your company – however some have found success registering both the .com and .net versions of their name.

If you need to register a domain name with your project, contact 102 Degrees. We’ll be glad to provide this service.


Newest Version of 102 Degrees Launched

May 3rd, 2008 by Aaron

To better reflect our business model and offer more services online to our visitors and customers, we’ve redesigned our website. Integration with the downloadable products, open source, technical blog and training materials enriches the website experience. Check out the new website options; all feedback is welcome.


Which Fires First? Error Handler or Shutdown Function

April 24th, 2008 by Aaron

I was working on writing a shutdown function for a PHP 4 script and noticed some odd behavior when I was getting errors (no way! I program and get errors? Who knew!?) At any rate, when I would handle my error with my custom function, I noticed the shutdown function was still executing after the error function. (Or when it was a Fatal error, the error was shown to the screen but the shutdown function was still ran…)

This got me to thinking about handling error redirection pages and sending messages on fatal errors in PHP4 (you’ll remember that a fatal error won’t execute the error handler, and therefore most of our custom code to make a nice ‘message’ won’t execute). But anyway, I digress.

I’m using PHP5.2 - this is the code I used to test:

1
2
3
4
5
6
7
8
9
10
11
<?php
function error_function() {
  print 'error function';
}
function shutdown_function() {
  print 'shutdown function';
}
set_error_handler('error_function');
register_shutdown_function('shutdown_function');
print 1/0;
?>

So, as you can tell, the error handler happens FIRST and then the shutdown function


©2008 102 Degrees LLC - All Rights Reserved Home Services Products Network Blog Open Source Learning Contact