Form submission test

This script is intended for people developing HTML-forms for interaction with PHP or any other type of serverside language or CGI. It's main purpose is to ebug the HTML-code for verification of correct form submission.

The script will show some info regarding submitted variables, either from GET or POST-requests. Cookies will also be shown by the script. Note: Cookies will only be sent to the server that originally sent them to the client. Thus you will most likely have to download the script and install it on your own server, you are trying to debug cookies. You can also view the source online and syntax-highlighted.

Using the script is as simple as setting the ACTION-part of your FORM. For instance you could use something like:

<form method="post" action="http://symlink.dk/code/php/submit/">

Whether you use POST or GET is not always given enough consideration. There are however a few things to keep in mind. First of all, according to the specifications, there might be a limit to the size of data submitted via a GET-request. This means that most browsers and web-serves do not handle more than 1024 bytes in a GET-request. So if you think there will be a need to submit more than 1024 bytes, you should probably use POST. The second thing is that of bookmarking. Since a GET-request holds all the data in the URL, this URL can be bookmarked by the user and reloaded at a later time. This can be usefull for search engines etc. Of course this also means you can create a link (an <a>-tag) that submits the information directly. This can be usefull since you do not need a form for submitting the data. It should be noted, however, that simply because you can detect whether POST or GET was used, you cannot assume that the submitted data came from your form. Of course faking the submission is a lot easier with a GET-request, but it is not very hard to make a copy of the HTML-form in a local file and modify it to submit the wanted values. This is also the major reason why client-side form validation is not sufficient. Although client-side validation can be quite handy, the server needs to make tha same validations, since the submitted data could easily be forged.

Returning to the question of POST or GET, you should prefer POST-requests when the result is in a special context, ie the user is logged in to a session. GET requests should only be used if the result of the submission does not depend on other data (in which case bookmarks would not work correctly).

For a simple test of the script, try a GET-request like http://symlink.dk/code/php/submit/?test=value

User AgentCCBot/2.0 (http://commoncrawl.org/faq/)
IP address54.81.94.117
Request MethodGET
Submitted Variables
No variables submitted
Cookies sent
No cookies

This script was made by Spaceman Spiff, http://symlink.dk

Last updated: 2005.04.29