Banner image
Web Publishing Help

phpESP Survey/Form Tutorial

Step 5: Deploy Surveys/Forms

If you have no further changes, click the "Finish" tag to complete the survey/form.

Finish Tab

Editing a Survey

  • Once a survey is finished, you may return to editing it by choosing "Edit an Existing Survey" from the Management Interface. Editing a survey uses the same interface as creating a new survey.

Testing a Survey

  • After you have created a survey/form, you can test it. Go to the Management Interface, select the "Change the Status of an Existing Survey" link and then select the "Test" link for the appropriate survey/form.
  • Once your survey/form is in test mode, you can access a live copy of it by going to the Management Interface and selecting "Test a Survey".
  • NOTE: Once a survey is changed to test mode, you can no longer make changes. If you just want to see how it will look, not test functionality, please use the preview option available when editing or creating a survey.

Deploying a Survey

  • To embed an active survey/form within an existing page you must add the following PHP tag (including the less than sign (<), greater than sign (>), and question marks) in your HTML page. You need to save the file that embeds your survey/form with a .php extension in order for the survey/form to work. (NOTE: This code was also given to you on the Finish tab of the survey design.)

     

    <?php
        $sid = YOUR_SURVEY_ID;
        include( '/www/htdocs/home/help/webtool/survey/public/handler.php' );
    ?>

     

    Include the following stylesheet in the <head> of your page to get your form to align properly:

    <link href="http://www.uri.edu/home/templates/css/phpesp.css" rel="stylesheet" type="text/css" media="screen" />


  • To access an active survey directly, go to

    http://www.uri.edu/home/help/webtool/survey/public/survey.php?name=YOUR_SURVEY_NAME

  • You must activate this survey before you can collect results. From the Management Interface, select Change the Status of a Survey.  A list of the surveys that your group owns will be displayed along with a list of action links ("Test", "Activate", "End" and "Archive").  Click on the "Activate" link to activate the appropriate survey/form.
  • Once a survey is active, you may no longer make any changes to it.

Embedding a survey/form in your HTML page

Copy all of the text in the box below and paste it into Notepad or any text editor.  Find the following code:

<?php $sid=put_fomr_number_here; include("/www/htdocs/home/help/webtool/survey//public/handler.php");?>

Replace the $sid number with the form id genereated by phpESP from the Finish tab and save the file as filename.php.

Displaying the real-time survey/form results

If you are an advanced user, you can also create a page that displays the real-time results of the survey/form.  Copy all of the text in the box below and paste it into any text editor.  Replace the $sid number with the form id provided in the Finish tab and save the file as results_filename.php.

Once saved, the files must be transferred to the server using an ftp client such as WS-FTP or Fetch. Visit the tutorial on how to WS_FTP and tutorial on how to use Fetch for details.

Move on to Step 6: View/Export Survey/Form Results

Back to Top