Collecting information from forms

There are two universal scripts provided for collecting information from webforms. They are /scripts/submit-log.php (for storing submitted data in a local file) and /scripts/submit-mail.php (for mailing submitted data to a collection email address).

Collecting data in a file

The script name is /scripts/submit-log.php. Example usage (in html):

<a href="/scripts/submit-log.php?logname=linkhit.txt&info=somedata">bla</a>
<form type="POST" action="/scripts/submit-log.php">
<input type="hidden" name="logname" value="nameform.txt">
Name: <input type="text" name="name">
<input type="submit">
</form>

Both GET and POST method are supported. The name of file to put the logs in should be given as a logname parameter. The filename must end in .txt and only contain letters, numbers, underscore characters and '-' characters.

The files are stored in /submitted-logs/ and must be created before the script is used. Careful with permissions as well.

Send data out to an email address

The script name is /scripts/submit-mail.php. Example usage:

<form type="POST" action="/scripts/submit-email.php">
<input type="hidden" name="logname" value="someemail@tcd.ie">
Name: <input type="text" name="name">
<input type="submit">
</form>

The logname attribute supplies an email address that the submitted data will be sent to. That address must be listed in the allowed addresses list in /addrs.txt. Submitted data cannot be more then 10 kilobytes in size (security precaution -- can be changed in php code).


Last modified Fri  8 August 2003 . View page history
Switch to HTTPS . Website Help . Print View . Built with GridSite 1.1.21