The answer to your question is, as always with computer:
"It depends on" I can tell you some about it by checking out the HTTP specifications, but I think I have provided you by enough information now so you will be able to find this information and figure it out your self. But even knowing this demands one know what kind of requirments are laid out for the implimentation. So it still depends on the situation. Anyhow, soem examples: GET is useful if you want to link data from one database to another at the web, then you can simply construct URL that cross link different databases. To see examples of this just check this URL out: http://www.ncbi.nlm.nih.gov/LocusLink/LocRpt.cgi?l=2125 This URL first post some query data to the database, and displays it, but the interesting thing in the answer could be find in the hyper links under the "Gene Ontology" link. There you will find (at this moment) three links: plasmodesma structural protein epidermal differentiation They all point to another database in the worlds located elsewhere, and they all post data in the same fashion as GET. POST, on the otherhand is useful if you want to send binary data, which GET can't deal with. There is also a difference in the HTTP transfer with POST and GET, I don't remember exactly how it was, but I think POST send the data in the body while GET sends the data in the header. If this is the case, then it might be that a GET request is faster handled by the webserver, than a POST, but this is pure speculations from my side and I don't really know if this is true or not. If you really want to know the advantage to use one method before the other, you should inspect the implementation of GET and POST (done by reading the RFC about HTTP) and then you will be able to judge about which one is "best" solution when no other precedence exists. Sorry if I sounds harsh, that's not my intention, but I do actually answer you on my working hours, so I can't help out to much, just fast things which requires less energy and thinking. Cheers, P.S. I don't know what a "DIY learner" is supposed to be? D.S. > -----Original Message----- > From: Samura1 [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 14, 2002 6:07 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-WIN] PHP & "POST" > > > One more thing, > I found that POST is better than GET as user won't see the variables .... > But there must be a disadvantage of POST, otherwise, no one use GET... > do you know what are the disadvantages of POST? > > Thank you. > > p.s and I'm looking for a very good website which talk about when you should > use this or when you shouldn't use this on PHP (including reasons) ... if u > know, pls let me know... as I'm a DIY learner, just trying everything out > but dunno it's a good way to do or not... > > > "Samura1" <[EMAIL PROTECTED]> 1/4?1/4g(c)o?lYo*s>D > :[EMAIL PROTECTED] > > Hey man, your post is very helpful ... > > > > But actually, I just found out the solution on the web... > > You know what, most web sites are just telling you what does it do (submit > > to the server, header...$#&Q*^$@#) , but doesn't give u an example... > > > > Until I just found an example on the web, make my mind much clearer... > > > > And your example is exactly what I need before... > > > > Thanks anyway.. > > > > > > > > "B.A.T. Svensson" <[EMAIL PROTECTED]> > > ???????:000601c243a6$fb3b12e0$[EMAIL PROTECTED] > > > Well lest go trough the basic steps then (but I still recomend you to > > visist the www.w3.org > > > and realy spend some time trying to understand the specifications - it > > will save you lots > > > of headache in the future...): > > > > > > First you start with the FORM tag: > > > > > > <form method=POST action=start.asp> > > > > > > Here we see two attributes METHOD and ACTION. > > > > > > METHOD should be POST in our case, and the ACTION is a pointer to a page > > that should > > > be handling the FORM request. In this case that page is called > START.ASP, > > in your > > > case it should probably be with the file extension .PHP. > > > > > > > > > What we then need is some interactive input fields: > > > > > > <select name=Tissue> > > > <option value=0>Unspecified</option> > > > <option value=1>Brain</option> > > > <option value=2>Eye</option> > > > <option value=3>Liver</option> > > > <option value=4>Heart</option> > > > <option value=5>Muscel</option> > > > <option value=5>Splein</option> > > > </select> > > > > > > We choice to display a drop down menu with some various items found > > > in the OPTION-tag. The SELECT as to be refereed with a NAME so we can > > > refer to it once the START.ASP page is loaded. The name of the variable > > > that START.ASP will be able to figure out which option we select will > > > hence be "Tissue". > > > > > > Finally we need a button to be able to submit the selected data: > > > > > > <input type=submit value='Go now' name=Submit> > > > > > > And then we ends the form: > > > > > > </FORM> > > > > > > Once we press the "Go Now" button, the form data will be posted to the > > > webserver, but the handlig page (START.ASP) need a script to extract > > > the data. This is done like this is VBScript: > > > > > > Tissue = Request.Form("Tissue") > > > > > > > > > In PHP I think a reference to a posted variable is done something like > > this: > > > > > > $HTTP_POST_VARS['Tissue']; > > > > > > Knowing this it should be a quite simple to continue with whatever you > > need to do. > > > > > > Check this link for more details about POSTing: > > > > > > > > > http://www.php.net/manual/en/language.variables.external.php#language.variab > > les.external.form > > > > > > If you want to uplaod a file instead, you might want to check this out: > > > > > > http://www.php.net/manual/en/features.file-upload.php > > > > > > > > > Cheers, > > > Anders > > > > > > > -----Original Message----- > > > > From: Samura1 [mailto:[EMAIL PROTECTED]] > > > > Sent: Wednesday, August 14, 2002 5:01 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: Re: [PHP-WIN] PHP & "POST" > > > > > > > > > > > > First, I don't know how to use POST, is it just changing the value GET > > in > > > > the form to POST? > > > > Secondly, because I don't know where does it send to, I don't know > where > > to > > > > get it, and I don't know how to get it even I know... so....... > > > > Anyone can show me an example coding for POST and how to get the data > > from > > > > POST pls.... > > > > > > > > "B.A.T. Svensson" <[EMAIL PROTECTED]> > > > > ???????:000001c24381$9ebbb8a0$[EMAIL PROTECTED] > > > > > Have you tried this URL yet: > > > > http://www.w3.org/TR/html401/interact/forms.html#edef-FORM > > > > > (www.w3.org might want to be your first choice when your are looking > > for > > > > specifications > > > > > details about HTML and HTTP transfers.) > > > > > > > > > > Also remember that GET is restricted to ASCII transfers, and if you > > > > happens > > > > > to have binary data you should uses POST. > > > > > > > > > > But more precisly what are your problems: > > > > > > > > > > 1) can't post the data > > > > > 2) can't get the values from posted data > > > > > 3) something else > > > > > > > > > > ?? > > > > > > > > > > Cheers, > > > > > Anders > > > > > > > > > > > -----Original Message----- > > > > > > From: Samura1 [mailto:[EMAIL PROTECTED]] > > > > > > Sent: Wednesday, August 14, 2002 12:32 PM > > > > > > To: [EMAIL PROTECTED] > > > > > > Subject: [PHP-WIN] PHP & "POST" > > > > > > > > > > > > > > > > > > Hey guys, > > > > > > I want to know how to retrieve data from POST (form) ... > > > > > > > > > > > > What I want to do is... > > > > > > > > > > > > I've got a textarea for ppl to enter large amount of text (essay), > > and I > > > > let > > > > > > ppl submit it (using POST), then insert these data into mySQL. > > > > > > > > > > > > I get it working if I use GET (I only know how to use GET, dunno > > about > > > > POST) > > > > > > with small amount of words (say 1600 characters), but when there > are > > > > more > > > > > > than 2000 characters, the submit button doesn't work. And I found > > that > > > > it is > > > > > > becoz GET does not allow too large amount of text appear in the > > URL... > > > > > > > > > > > > So anyone can teach me how to get data from POST? I read some web > > sites > > > > but > > > > > > still have no idea how to do it ... I think I need an example... > > > > > > > > > > > > Please help > > > > > > > > > > > > > > > > > > > > > > -- > > > > PHP Windows Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php