Martin Atkins (mart) wrote in lj_dev,
Martin Atkins

Making HTML email forms work outside OE and Netscape

This has been discussed a little, and it would seem that external email clients such as Eudora and Pegasus have trouble producing POST requests in browsers since the browsers don't provide a way to launch a POST request from the command line.

I'm wondering if these clients would be happier if we used a GET request from the forms in the emails. Email clients could then launch the browser with a mega-long URL and stand more chance of getting their intentions known.

There are some issues with this approach, though. Firstly, using a GET request for something which makes changes on the server is not advisable because a refresh could cause it to happen again with no user prompting, and if it's stuck in the users' history they might accidentally press the back button to return to it and possibly post the comment again. My solution to this is to throw out a 302 redirect to a 'safe' URL after the database bit has been done. This safe URL would just be a page saying "Success - your comment has been posted" - doesn't even need to have any code on it, although the itemid and talkid could be passed in the query string so a link to the comment can be provided. In sane browsers, a 302 redirect should cause the new location to replace the bad one in the browser's history thus removing the 'back' problem.

The other issue is that it would create some awful long URLs in the server logs. Brad has expressed his distaste at doing this before, and I can see where he's coming from. Turning off the logging of URLs with their query string doesn't seem like a good idea, either. I have no solution to this problem, but perhaps people will consider this important enough that we can just suffer this minor inconvenience.


  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded