Re: Automajickally POST to a remote form
| From: | Chris Shiflett | Date: | Mon, 25 Nov 2002 19:47:11 +0000 |
| Subject: | Re: Automajickally POST to a remote form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125980@lists.php.net to get a copy of this message | ||
--- Kris Williams <ahrt@enternet.com.au> wrote:
> Once upon a time I used to be able to POST form data to external
> sites with ASP and an MSXML (or something) server object on IIS
> and I'm wondering if there's a similar sort of technique using
> PHP.
You can post with PHP using cURL or doing it yourself manually.
Search the archives for this, as the previous answers to this are
more complete than what I have time to explain now. Here is a quick
example of the manual approach:
http://shiflett.org/tutorials/php_post.txt
> The easiest description of what I'm attempting is: user hits PHP
> page, page submits predefined search terms to Google and the
> results are displayed.
Since Google's search uses GET, your question about POST doesn't
matter anyway. The following URL will display the search results of a
Google search on PHP:
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=PHP&btnG=Google+Search
If you are wanting to display the search results on your own page,
you should use Google's API. I believe parsing their HTML results
violates the terms of use, so you might want to read that if you do
not want to use the API.
The API can be found here:
http://www.google.com/apis/
A low-level demonstration of how the API works is given here (I plan
to improve this when I have time):
http://shiflett.org/tutorials/google.php
Hope that helps.
Chris