Creating a new Telegraph form

  1. Create an HTML form.
  2. Set your HTML form to use Telegraph by adding either of the following <form> tags.
    • For general-use forms:
      <form action="/phpbin/telegraph/index.php">
    • For Kerberos-protected forms:
      <form action="/phpbin/telegraph/login/index.php">
  3. Create a telegraph directory in the parent directory.
  4. Create a .htaccess file in the subdirectory telegraph. In order to prevent any email addresses and other potentially-sensitive information in your configuration file from being web-accessible, create the .htaccess file with the contents “deny from all”.
  5. Create a blank Telegraph configuration file in the telegraph directory. You can name the file whatever you would like, but it must end in .xml. Most forms use config.xml.
  6. Add these lines of code to your HTML form, underneath the opening <form> tag:
    • <input type=”hidden” name=”form_configuration” value=”telegraph/myconfigurationfile.xml” />
      <input type=”hidden” name=”form_location” value=”/parent-directory-of-my-form“>

      • Example:
        <input type=”hidden” name=”form_configuration” value=”telegraph/config.xml” />
        <input type=”hidden” name=”form_location” value=”/cragglerock/”>

      The form location is relative to the www.bu.edu root directory, e.g., /cragglerock/ for http://www.bu.edu/cragglerock/.

  7. You can now add form functions using specific directives.

For examples of complete Telegraph form code and configuration files, see our list of examples.

Converting a PonyExpress form

  1. Locate your HTML form.
  2. If present, delete any Formlogin-related code and variables:
    • Javascript
      E.g., <script language=”JavaScript” src=”../../../common/formlogin.js” type=”text/javascript”></script>
    • Variables (recognizable by the starting character $)
      E.g., $firstname, $lastname, $email.
    • Any related text
      E.g., Welcome $firstname.
  3. Remove any PonyExpress-specific form code. A typical set of PonyExpress-specific code is seen below:
    • <form method=”post” action=”/htbin/ponyexpress2″>
      <input type=”hidden” name=”to” value=”someone@bu.edu”>
      <input type=”hidden” name=”form_location” value=”/somesite/comments/”>
      <input type=”hidden” name=”return” value=”thankyou.html”>
      <input type=”hidden” name=”output” value=”index.html”>
      <input type=”hidden” name=”required” value=”lastname, firstname, email, comments”>
      <input type=”hidden” name=”mail_to_admin” value=”yes”>
      <input type=”hidden” name=”mail_to_visitor” value=”yes”>
      <input type=”hidden” name=”timestamp” value=”!date”>
    • All hidden input tags except for form_configuration and form_location (added below) should be deleted.
  4. Add in Telegraph-specific form code, as described above:
    • For general-use forms:
      <form action="/phpbin/telegraph/index.php">
    • For Kerberos-protected forms (including forms that used Formlogin):
      <form action="/phpbin/telegraph/login/index.php">
  5. Create a subdirectory telegraph in the parent directory.
  6. Create a .htaccess file in the subdirectory telegraph. In order to prevent any email addresses and other potentially-sensitive information in your configuration file from being web-accessible, create the .htaccess file with the contents:
    AuthType weblogin
    <Limit GET POST>
    require valid-user
    </Limit>
  7. Create a blank Telegraph configuration file in the telegraph directory. You can name the file whatever you would like, but it must end in .xml. Most forms use config.xml.
  8. You can now add form functions using specific directives.

For examples of complete Telegraph form code and configuration files, see our list of examples.