Creating a new Telegraph form
- Create an HTML form.
- 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">
- For general-use forms:
- Create a telegraph directory in the parent directory.
- 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”.
- 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.
- 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/.
- Example:
- <input type=”hidden” name=”form_configuration” value=”telegraph/myconfigurationfile.xml” />
- 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
- Locate your HTML form.
- 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.
- Javascript
- 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.
- <form method=”post” action=”/htbin/ponyexpress2″>
- 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">
- For general-use forms:
- Create a subdirectory telegraph in the parent directory.
- 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> - 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.
- You can now add form functions using specific directives.
For examples of complete Telegraph form code and configuration files, see our list of examples.