POst in a serverside way

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RicercatoreSbadato

    POst in a serverside way

    Hi all,
    I have to make a post in php but from the server (serverside).

    I've though to use the system("wget ..");

    but surely exist others solutions... which?

  • Sjoerd

    #2
    Re: POst in a serverside way

    You could use sockets to connect to the webserver. Take a look at
    fsockopen.

    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: POst in a serverside way

      RicercatoreSbad ato wrote:[color=blue]
      > Hi all,
      > I have to make a post in php but from the server (serverside).
      >
      > I've though to use the system("wget ..");
      >
      > but surely exist others solutions... which?[/color]

      Google "post2host" . Functions and usernotes to refer: fsockopen,
      fopen & curl.

      --
      <?php echo 'Just another PHP saint'; ?>
      Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

      Comment

      • C.

        #4
        Re: POst in a serverside way

        Creating your own HTTP stack is not trivial, although it is the only
        way to solve certain types of problem (not this one though). Having
        said that I did it and it run approximately 10x faster than starting up
        an instance of the curl program (similar to wget).

        The fastest and simplest solution is to use the libcurl extension.

        If you need to be able to handle redirection and cookies, IIRC there is
        a project on Sourceforge called snoopy which might serve you better.

        HTH

        C.

        Comment

        • Erwin Moller

          #5
          Re: POst in a serverside way

          RicercatoreSbad ato wrote:
          [color=blue]
          > Hi all,
          > I have to make a post in php but from the server (serverside).
          >
          > I've though to use the system("wget ..");
          >
          > but surely exist others solutions... which?[/color]

          Hi,

          Look up CURL at www.php.net.

          CURL let you add name/value pairs and will produce a 'real post', as if
          posted by a browser.

          Have fun!

          Regards,
          Erwin Moller

          Comment

          • RicercatoreSbadato

            #6
            Re: POst in a serverside way

            Thank you! ;)

            Comment

            Working...