Began to familiarize with the API, which allows the sending of SMS messages. enter image description here

Not driven from the start. How to call this address using GET or POST?

    3 answers 3

    See the cURL library. See here how to work:
    http://phpclub.ru/detail/article/curl

    I would even in your place make a class to work with API using this library.

    • It produces an error: Fatal error: Call to undefined function curl_unit (). I did everything as described, i.e. copied the necessary files into system32, uncommented extension = php_curl.dll in php.ini. What could be the problem? - luckydutch
    • It was sealed up, there is curl_init (), but it still does not work. - luckydutch
    • I read a bunch of forums, everywhere the same tips. I tried everything, threw the dll files and into the folder php / ext and just in php and in windows / system32 and just in windows. phpinfo () generally does not see curl. - luckydutch
    • Do you have a Denver? Restart denver did? in apache logs did not look does not write anything about curl? - iproger
    • I have xampp, apache accordingly. I understand better denwer juzat? because judging by the reading, there are no problems with it, or there are fewer of them. - luckydutch

    There are many clients who can make HTTP ( GET , POST , PUT , DELETE ...) requests (including your browser).

    If you want to figure it out:

    Sockets - http://php.net/manual/en/sockets.examples.php (Sockets can do a lot more.) CURL - http://php.net/manual/en/book.curl.php

    And if just that would work:

    Guzzle - https://github.com/guzzle/guzzle

      It can be called using GET or POST. In this case, GET is better:

       echo file_get_contents('https://smsc.ru/...'); 
      • If you do this without using cURL, you get the error "Failed to open stream" - luckydutch
      • If localhost, then there is no https requests to send. - ModaL