sending a post to another php script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Man-wai Chang

    sending a post to another php script


    I knew the GET way ('called.php?pa ra1=aaa&para2=x xxx'),
    but how about the POST way?

    --
    iTech Consulting Services Limited
    Expert of ePOS solutions
    Website: http://www.itech.com.hk (IE only)
    Tel: (852)2325 3883 Fax: (852)2325 8288
  • Kimmo Laine

    #2
    Re: sending a post to another php script

    "Man-wai Chang" <toylet.toylet@ gmail.comwrote in message
    news:460c9e65@1 27.0.0.1...
    >
    I knew the GET way ('called.php?pa ra1=aaa&para2=x xxx'),
    but how about the POST way?
    >

    You must learn the ways of the cURL if you're to post a request to another
    file.



    --
    "Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
    http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
    spam@outolempi. net | rot13(xvzzb@bhg byrzcv.arg)


    Comment

    • Roy Kaldung

      #3
      Re: sending a post to another php script

      Man-wai Chang schrieb:
      >
      I knew the GET way ('called.php?pa ra1=aaa&para2=x xxx'),
      but how about the POST way?
      >
      Hi,

      the PEAR package HTTP_Client does it.


      Comment

      • Manuel Lemos

        #4
        Re: sending a post to another php script

        Hello,

        on 03/30/2007 02:21 AM Man-wai Chang said the following:
        >
        I knew the GET way ('called.php?pa ra1=aaa&para2=x xxx'),
        but how about the POST way?
        You may want to take a look at this popular HTTP client class. It
        supports cookie handling, authentication, redirection, SSL, etc..




        --

        Regards,
        Manuel Lemos

        Metastorage - Data object relational mapping layer generator


        PHP Classes - Free ready to use OOP components written in PHP
        Free PHP Classes and Objects 2026 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials

        Comment

        • Rob D

          #5
          Re: sending a post to another php script

          You can do as various others have suggested but there is a built in
          php way:

          $vars = array("id" =$_REQUEST['id'],
          "header" =$_REQUEST['header'],
          "abstract" =$_REQUEST['abstract'],
          "body" =$_REQUEST['body']
          );
          http_post($serv er, $port, $url, $vars);

          It's perhaps self-explanatory, I'm getting four posted attribute/value
          pairs from the request stream which I'm storing with the same names
          (you could change them if you wanted) into an array called $vars. I
          then call http_post passing the server, port and url of where I'm
          connecting to with the posted array as the last parameter.

          Rob

          On Fri, 30 Mar 2007 13:21:33 +0800, Man-wai Chang
          <toylet.toylet@ gmail.comwrote:
          >
          >I knew the GET way ('called.php?pa ra1=aaa&para2=x xxx'),
          >but how about the POST way?

          Comment

          Working...