A cfhttp “POST” in php

后端 未结 2 2079
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-22 14:37

I have a ColdFusion page that appends the a URL with form variables. I\'m trying replicate this code in php:

 

        
2条回答
  •  没有蜡笔的小新
    2021-01-22 15:03

    The HTTP PECL extension (which contains the HTTPRequest class) isn't part of a default PHP installation.

    I would take a look at CURL: http://php.net/manual/en/book.curl.php. You can set the HTTP method and parameters.

    Or, if you don't mind using a framework, checkout the Zend FW HTTP Client module: http://framework.zend.com/manual/en/zend.http.html

    Here's an example of using CURL to do a post request: http://davidwalsh.name/execute-http-post-php-curl

提交回复
热议问题