Click to See Complete Forum and Search --> : POST vs. GET


grendelguf
06-10-2003, 01:51 AM
I currently have this website:

http://members.aol.com/grendelguf/comiclist/order.html

It has one problem, though. If you enter too many items, it won't submit. I know why: The method is GET on the form, even though it is not defined (see the order.html source). If I do define it as POST, it doesn't submit any values. However, when I test the pages locally, they work fine, and the method defaults to POST. Notice I'm using AOL's hosting for members (the limited ftp space they give members). Is it simply AOL that doesn't allow forms to POST? Is there a free host that does allow it? Moreover, is this really the problem? You can easily download the two pages and run them locally to see what I mean. I know the problem is likely that the GET method is overloading the browser with the values submitted. Anyway, I've been teaching myself this stuff for a while. I'm fairly knowledgeable, but I don't know that much about the back-end on the server side. Thanks in advance.

DaiWelsh
06-10-2003, 12:27 PM
I believe your are correct about the reason, GET requests are the default and are restricted to a (relatively) short url length. wrt the POST blocking, this is usually done depending on the file type (ie extension) of the page being submitted to, so you might find that POST is blocked for .html files but would work for .asp or .php, however I would expect to get a 'Method not allowed' type message if this was the case.

I think the problem actually lies with your use of javascript to process the form, the javascript code will only have access to the url of the page and hence to data submitted with GET. If the form uses POST the data is sent to the server fine, but is not then available when the following page is loaded by the browser and the javascript code runs.

The solution is either to restrict the size of the form - :( - or to find a server-side solution to this problem rather than using javascript that is not really suitable for several reasons.

Sorry if that is not what you want to hear ;)

Regards,

Dai

grendelguf
06-10-2003, 12:59 PM
Thanks. I reduced the form and it works fine as long as no one wants to order everything on the order form. I know now that asp is probably the solution, but the site's free, I don't want to invest that much time in it, etc etc. so it will probably stay like it is until one of the comic websites gets smart and makes one of their own. I did this to fill a gap for some comic users until that happens. Thanks for clarifying everything! I'm new, so please let me know the method to rate your response. Thanks again!