CXO

Use this PHP tool to create surveys and gather feedback

If you want to get a handle on what your users really think, phpESP may come in handy. This open source application lets you build and analyze Web surveys with PHP and MySQL.


How do you know what your Web site users really want or like? Thanks to a whole industry of companies that offer online polling and survey tools, you don't need to guess—you can ask your users directly.

One such tool for Web surveys is called the PHP Easy Survey Package (phpESP). It's an open source application that is OS independent (it runs on various UNIX flavors as well as Windows). All you need on your server is PHP and MySQL.

Installation
PhpESP is dead easy to set up and run. The first step is to download the most up-to-date version of the program, which you can find at phpesp.sourceforge.net. The project offers only a tarball (.tar.gz), but don't be afraid; it's not a UNIX-only type of install. Current versions of WinZip uncompress tarballs on Windows without a problem. I didn't have to recompile or add additional mods to the environment. All I had to do was untar the program and set up the database.

PhpESP provides two simple scripts that make database setup quick and easy. There's a phpESP config file that you'll need to edit to make sure that you've specified the right name, user, and password for the database and paths to Perl and Sendmail on your server. All of the functionality of phpESP is browser-based, so to get started, just go to the URL you configured for the program.

What can it do?
The core of phpESP is controlled through the Management Interface (Figure A), where users—depending on their groups and permissions—perform the various survey functions.

Figure A
phpESP Management Interface


Apart from not being a very interesting-looking user interface (the phpESP development group is working on improvements to the interface), it's all quite straightforward. Once you're logged in to the Management Interface, links are available to handle all the tasks you might expect, such as creating or editing a survey. You can also display survey results graphically or export them into a CSV file.

Setting up a new survey is pretty simple. You start by clicking Create A New Survey to open the first tab of the Survey Design process. Here, you name your survey, specify confirmation pages, and select the theme. There is no theme engine in phpESP, and there are only four built-in themes. However, it's all CSS-based, so it's easy enough to open your favorite editor and define your own theme that will load into the program.

As you can see in Figure B, PhpESP allows for a number of survey question types, including:
  • Yes/No
  • TextBox and EssayBox ( the only difference is single vs. multiline responses)
  • Radio Buttons
  • Check Boxes
  • Dropdown Box
  • Rate (scale of 1 to 5)

Figure B
phpESP lets you specify various types of questions.


Unfortunately, there's no template to guide you in setting up a survey or even examples of how to structure it. I have a bit of a research background, so I had some idea of how I wanted to structure my survey and what types of questions I wanted to ask. If you want to learn more about survey design, you might try a book such as Survey Research Methods or How to Conduct Surveys: A Step by Step Guide.

How do you know what your Web site users really want or like? Thanks to a whole industry of companies that offer online polling and survey tools, you don't need to guess—you can ask your users directly.

One such tool for Web surveys is called the PHP Easy Survey Package (phpESP). It's an open source application that is OS independent (it runs on various UNIX flavors as well as Windows). All you need on your server is PHP and MySQL.

Installation
PhpESP is dead easy to set up and run. The first step is to download the most up-to-date version of the program, which you can find at phpesp.sourceforge.net. The project offers only a tarball (.tar.gz), but don't be afraid; it's not a UNIX-only type of install. Current versions of WinZip uncompress tarballs on Windows without a problem. I didn't have to recompile or add additional mods to the environment. All I had to do was untar the program and set up the database.

PhpESP provides two simple scripts that make database setup quick and easy. There's a phpESP config file that you'll need to edit to make sure that you've specified the right name, user, and password for the database and paths to Perl and Sendmail on your server. All of the functionality of phpESP is browser-based, so to get started, just go to the URL you configured for the program.

What can it do?
The core of phpESP is controlled through the Management Interface (Figure A), where users—depending on their groups and permissions—perform the various survey functions.

Figure A
phpESP Management Interface


Apart from not being a very interesting-looking user interface (the phpESP development group is working on improvements to the interface), it's all quite straightforward. Once you're logged in to the Management Interface, links are available to handle all the tasks you might expect, such as creating or editing a survey. You can also display survey results graphically or export them into a CSV file.

Setting up a new survey is pretty simple. You start by clicking Create A New Survey to open the first tab of the Survey Design process. Here, you name your survey, specify confirmation pages, and select the theme. There is no theme engine in phpESP, and there are only four built-in themes. However, it's all CSS-based, so it's easy enough to open your favorite editor and define your own theme that will load into the program.

As you can see in Figure B, PhpESP allows for a number of survey question types, including:
  • Yes/No
  • TextBox and EssayBox ( the only difference is single vs. multiline responses)
  • Radio Buttons
  • Check Boxes
  • Dropdown Box
  • Rate (scale of 1 to 5)

Figure B
phpESP lets you specify various types of questions.


Unfortunately, there's no template to guide you in setting up a survey or even examples of how to structure it. I have a bit of a research background, so I had some idea of how I wanted to structure my survey and what types of questions I wanted to ask. If you want to learn more about survey design, you might try a book such as Survey Research Methods or How to Conduct Surveys: A Step by Step Guide.

When you finish inputting all of your questions, phpESP gives you the option of deciding on their order. It's a great feature for me because I can just brain-dump my questions and then figure out the right order later. No need to figure out both the questions and the order up front.

After arranging your questions, you can preview the survey. Then, when you're satisfied with your survey design and content, click through to Finish. You'll be greeted with the message "Survey Design Completed." However, your work to get this survey live is not quite complete.

The program provides two options for linking and accessing your survey on a live page. The first is a php inclusion that looks something like this:
<?php $sid=#; include("/var/www/html/yourdomain /phpESP/public/handler.php");?>

The second option is to access it directly from a URL, like this:
http://www.yourdomain.com/phpESP/public/survey.php?name=surveyname

The survey is still not live. Now go back to the main management interface and change the status of the survey to active. At first, I thought this was an unnecessary step, but it does make sense. With phpESP, once you publish the survey, you can no longer make changes to the live version—it's fixed forever. You can copy a live survey, edit it, and then republish it, but you lose any of the data that may have been captured in the survey up to that point. I learned that fact the hard way with my first survey. So don't make the survey active until you're absolutely certain that it's exactly the way you want it.

The results
You can view survey results using the option on the Management Interface or, like the survey itself, you can see them embedded as a php include or URL. PhpESP is much more than a basic polling script. Cross-analysis and cross-tabulation of survey results are useful and powerful features, allowing you to compare responses inside your survey. For example, how did respondents who answered yes to the first question answer all the other questions? Cross-tabulation lets you see in a table format the results of two or more questions in comparison to the others.

A few drawbacks
One of the things that bugged me about phpESP was documentation, or rather the lack thereof. The Management Interface offers only an incomplete user and administrator's guide. And critical information such as how to use the cross-analysis features are hidden deep in places that are not directly related to cross-analysis. Not a big deal, but annoying enough. The install documentation also suggests specifying a [base URL] inside of its php.ini script, which isn't really necessary; I had it working as is.

From a statistical point of view, the current stable release version of phpESP does not have any timeouts based on user IP or cookie. This means that a user could repeatedly vote and stuff the ballot box. The FAQ addresses this and suggests that the administrator set up a private poll where users must log in. That makes sense to me, except that with phpESP, there's no automated login/registration component. Users would have to have their login/password manually set by the admin and then sent to them. It's hardly practical for a large survey base, although it will work for small groups. However, there's a port that integrates with my current open source CMS of choice, Postnuke. PnESP (postnukeESP) alleviates my anxiety about ballot stuffing, as Postnuke itself has an automated user registration system. Allow only registered users to vote and you're set.

The upshot
Overall, I found phpESP to be a useful tool. It's the most user-friendly, easy-to-use open source survey tool I've seen.

When you finish inputting all of your questions, phpESP gives you the option of deciding on their order. It's a great feature for me because I can just brain-dump my questions and then figure out the right order later. No need to figure out both the questions and the order up front.

After arranging your questions, you can preview the survey. Then, when you're satisfied with your survey design and content, click through to Finish. You'll be greeted with the message "Survey Design Completed." However, your work to get this survey live is not quite complete.

The program provides two options for linking and accessing your survey on a live page. The first is a php inclusion that looks something like this:
<?php $sid=#; include("/var/www/html/yourdomain /phpESP/public/handler.php");?>

The second option is to access it directly from a URL, like this:
http://www.yourdomain.com/phpESP/public/survey.php?name=surveyname

The survey is still not live. Now go back to the main management interface and change the status of the survey to active. At first, I thought this was an unnecessary step, but it does make sense. With phpESP, once you publish the survey, you can no longer make changes to the live version—it's fixed forever. You can copy a live survey, edit it, and then republish it, but you lose any of the data that may have been captured in the survey up to that point. I learned that fact the hard way with my first survey. So don't make the survey active until you're absolutely certain that it's exactly the way you want it.

The results
You can view survey results using the option on the Management Interface or, like the survey itself, you can see them embedded as a php include or URL. PhpESP is much more than a basic polling script. Cross-analysis and cross-tabulation of survey results are useful and powerful features, allowing you to compare responses inside your survey. For example, how did respondents who answered yes to the first question answer all the other questions? Cross-tabulation lets you see in a table format the results of two or more questions in comparison to the others.

A few drawbacks
One of the things that bugged me about phpESP was documentation, or rather the lack thereof. The Management Interface offers only an incomplete user and administrator's guide. And critical information such as how to use the cross-analysis features are hidden deep in places that are not directly related to cross-analysis. Not a big deal, but annoying enough. The install documentation also suggests specifying a [base URL] inside of its php.ini script, which isn't really necessary; I had it working as is.

From a statistical point of view, the current stable release version of phpESP does not have any timeouts based on user IP or cookie. This means that a user could repeatedly vote and stuff the ballot box. The FAQ addresses this and suggests that the administrator set up a private poll where users must log in. That makes sense to me, except that with phpESP, there's no automated login/registration component. Users would have to have their login/password manually set by the admin and then sent to them. It's hardly practical for a large survey base, although it will work for small groups. However, there's a port that integrates with my current open source CMS of choice, Postnuke. PnESP (postnukeESP) alleviates my anxiety about ballot stuffing, as Postnuke itself has an automated user registration system. Allow only registered users to vote and you're set.

The upshot
Overall, I found phpESP to be a useful tool. It's the most user-friendly, easy-to-use open source survey tool I've seen.

Editor's Picks