I see these PHP sripts that automate taskts use something called 'post' and 'get' and sometimes a 'text file' as well. How does all of this work? For example, there isa pHP script that generates myspace bulletins and it uses 'get' and 'post' funtions and a .txt file.
Hi, You need to read up on how the internet works. You see, websites are served on the internet through a protocol called HTTP. When we type in a URL in our browser, it sends a GET request to the server. Like for example, if we access, www.coderlinks.com/index.php, the browser sends a request GET /index.php HTTP/1.1 Host: coderlinks.com You can also send data through get like this: Basically its asking the server to give the index.php file. The HTTP/1.1 part indicates the HTTP Protocol version. GET /index.php?p=d Host: coderlinks.com Here also the same file is fetched except that the file gets a variable named p with the value 'd' . One place you see this is in HTML forms, like the ones that ask you to subscribe to a mailing list and all. The default method used in forms in GET. So when you type in the email and click submit, you are in effect visiting the address: http://www.blahbla.com/mailing.php?name=Your_Name&email=Your_email the two different data are separated by an '&' symbol. POST is another way of sending data. Here instead of putting the data in the URL, it is put in the request itself, so that the URL looks clean. Like this: POST mailform.php HTTP/1.1 Host: coderlinks.com Content-type: application/x-www-form-urlencoded Content-length: 31 name=Your_Name&email=Your_email And text file is just that, a text file . I dont know what are myspace bulletins as I dont use MySpace. But maybe, they just use GET to get some data from an internet page and store this info in text files. This data is later taken from the text file show the data. If you didn't understand all that, I suggest you read up on the working of the internet and HTTP. I will give you some useful resoruces: http://www.wdvl.com/Internet/Protocols/HTTP/Request.html http://en.wikipedia.org/wiki/Internet#Internet_protocols http://en.wikipedia.org/wiki/HTTP Thomas
i'll try to answer that in simpler terms... e.g. you can specify a php page as the 'action' of a form... and when the user click on the submit button on the form, the values of the individual fields of the form gets passed over to the php page specified through the use of $_POST['field_name'] e.g. in the url, you sometimes see ?variable=value... e.g. http://www.mydomain.com/page.php?var=hello - in the php code of page.php, you can read what was passed in through the ?var=hello part as $_GET['var']... hopefully the above made it a little simpler...