Re: Manually make a POST request?



703designs wrote:
On Oct 29, 2:40 pm, FutureShock <futuresho...@xxxxxxx> wrote:
703designs wrote:
I'm writing a little Drupal module that implements a couple forms,
relaying the submitted values to a third-party site. I know the target
URL and I have all of the values that I want to submit with the POST
request, so how can I invoke this request directly from a PHP script?
I am not 100% on this but I think it can be accomplished with 'curl'.

http://us2.php.net/curl

Let me know if that works for you.
Unless Curl isn't installed, of course. On most servers, this is fine,
but I'm stuck developing on a Windows box right now. I'm tinkering
with socket functions, and I could always use this utility function:
http://www.jonasjohn.de/snippets/php/post-request.htm
(Top-posting fixed.)

cURL works just as well on Windows. However, you should not need it unless you need to things like accept cookies or, perhaps, deal with SSL.

You should be able to use fsockopen(), otherwise. Using google, you can figure out how to send a POST request. The HTTP RFC, for example might help.

<URL:http://php.net/fsockopen>

P.S.: most people prefer bottom-posting.
--
Curtis
$eMail = str_replace('sig.invalid', 'gmail.com', $from);
.



Relevant Pages

  • Re: Windows Server Referral Problem
    ... EN> Markus I have a request out to Microsoft to get more information ... When Windows ... and returns a referral to the specified realm if there's a match. ... EN> I have a problem with server referrals in my Windows environment. ...
    (comp.protocols.kerberos)
  • IPSEC with certificates on Windows XP (Certificate donīt have a private key )
    ... I have a question for the Microsoft CSP and IPSEC. ... I have installed a small network of 4 computers. ... computers and two windows 2000 computers. ... The program certreq.exe generate a certificate request. ...
    (microsoft.public.platformsdk.security)
  • Re: call is blocked in recvfrom() and no further proceedings in Wi
    ... For transmitting UDP packets through emulator, ... >> In windows CE, I'm able to send a request but I'm unable to receive it. ... >>> My program has to send request to service through port 5070(in this port ...
    (microsoft.public.windowsce.embedded)
  • .net user permissions in IIS
    ... We have a windows 2003 domain with 4 web servers in. ... (Exception from HRESULT: 0x80070005 ... the current web request. ...
    (microsoft.public.dotnet.framework.aspnet)
  • [NT] Invalid Universal Plug and Play Request Can Disrupt System Operation
    ... Invalid Universal Plug and Play Request Can Disrupt System Operation ... Windows ME and XP include native UPnP ... manufacturers do, however, install it on the systems they sell) ...
    (Securiteam)