PHP + curl - A Simple example of how to use cURL

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 51

  • @jherbison
    @jherbison  3 роки тому +16

    I use cURL a lot in development. Let me know here in the comments if you want me to expand on the example and even possibly build out a full API that can pull data from another site.

    • @pmakosyo
      @pmakosyo 3 роки тому +2

      Yeah, why not. Go for it.

    • @jherbison
      @jherbison  3 роки тому +2

      Cool! Thanks!

    • @jherbison
      @jherbison  3 роки тому

      What do you need help with? You can email me at josh@ideapro.com

    • @mohanwijesena6272
      @mohanwijesena6272 2 роки тому

      Are you able to show how to use a refresh_token once and main token is expired?

  • @nikolav6350
    @nikolav6350 3 роки тому +5

    You are the king of PHP . Thanks for tutorials!

    • @jherbison
      @jherbison  3 роки тому

      Ha! Thanks. Thanks for watching and commenting.

  • @JillRhoads
    @JillRhoads 2 роки тому +2

    This was EXACTLY what I was looking for. Thanks for putting in json with it as well and keeping it as simple as possible. Now I can do my REST API calls without bothering the external API server the whole time.

  • @elkhanhamet2561
    @elkhanhamet2561 2 роки тому +1

    thank you very much sir. I couldn’t grasp the true essence of cURL until I watched your tutorial. Great video!!!😊👏👏👏

  • @oliver1121
    @oliver1121 2 роки тому

    Thank you for mentioning that there are curl builders out there! Twillio only gives curl examples on their examples and I found a curl to php website that has done all the hard work for me :D

  • @oshinsaginian
    @oshinsaginian Рік тому +1

    Thank you Joshua so much for your explicit [ detailed ] explanation - Love to watch your videos and learn.

    • @jherbison
      @jherbison  Рік тому

      Awesome.. Thank you for watching and commenting.

  • @sebastiannieroda9022
    @sebastiannieroda9022 3 роки тому +1

    Of course we are waiting for the expand of this topic

    • @jherbison
      @jherbison  3 роки тому

      Cool. I will work on that video. Thanks for watching and commenting.

  • @JerrySmith-nq9mj
    @JerrySmith-nq9mj 3 роки тому +1

    Thanks for this Joshua. If you ever get a chance I'd like to see a tutorial on the POST method for cURL. Basically filling out a form and then sending that data using cURL and a JSON File.

    • @jherbison
      @jherbison  3 роки тому

      Ok, I will add that to the list and do that video next.. Possibly today or the next couple of days. Thank you for watching and commenting.

  • @olamideoshiyokun7317
    @olamideoshiyokun7317 21 день тому

    I love this so much...... thanks Josh

  • @adventuretime6457
    @adventuretime6457 2 роки тому

    best video regarding curl php

  • @theman7050
    @theman7050 2 роки тому +1

    Hello Joshua,
    You mentioned that you used cURL to track number of sold products from your client's site.
    So could you plz briefly mention the main points of the process? I mean, one could also put a plugin that would fire on every successful sale and contact an external API via POST method. But I guess cURL allows intrusion without login or inserting plugin as it can easily be deleted by client.
    What makes cURL ideal for this circumstance.
    Im still learning backend WP and finding your tutorials very VERY helpful. Dnt stop plz. :)
    Although a video on using cURL to track something like purchases on a client site would be great ✌🏼🙂

    • @jherbison
      @jherbison  2 роки тому +1

      Sorry for the delay in responding.. I just released a video that addresses your question... Kind of!!!! I will address the Curl on another video this week.
      ua-cam.com/video/V_My277URS8/v-deo.html

    • @theman7050
      @theman7050 2 роки тому

      @@jherbison Thank you soo much mate :D

  • @Daud181
    @Daud181 3 роки тому +2

    Great video sir we need more interesting video

    • @jherbison
      @jherbison  3 роки тому +1

      Like what? Thanks for watching and commenting.

    • @Daud181
      @Daud181 3 роки тому

      @@jherbison like how we make a simple preloader plugin CSV maker plugin print functionality and forms etc

  • @dfrontierit2114
    @dfrontierit2114 2 роки тому

    Thank you this helped in one of my projects

  • @gagarin-d
    @gagarin-d 2 роки тому +1

    Спасибо за видео

    • @jherbison
      @jherbison  2 роки тому

      Пожалуйста. Спасибо за просмотр и комментарий.

  • @phoneyiam123
    @phoneyiam123 3 роки тому +1

    Would love to see a vid on using cURL in wordpress to hide API keys. I'm using leaflet map and need an API key in my markers url and I can't figure out how to hide it.

    • @jherbison
      @jherbison  3 роки тому +1

      Not sure I completely understand. Who are you trying to hide the API keys from? If it is PHP with Curl, the only people that could see the API key is anyone that has access to the code. PHP code isn't viewing to the public.

    • @phoneyiam123
      @phoneyiam123 3 роки тому +1

      @@jherbison Sorry for the vague comment. I have a real estate website that is pulling listings from a json url and displaying those listings on a map. This is done via javascript so all the code is visible in the source and that includes the url to the json file which contains an API key.
      I was told I needed to use cURL to hide the key and then call to it via a variable in my javascript code. I'm a bit of a novice so I'm pretty lost.

    • @jherbison
      @jherbison  3 роки тому +1

      Oh ok, can you email me more details at josh@ideapro.com?

    • @phoneyiam123
      @phoneyiam123 3 роки тому

      @@jherbison Sending you an email now!

    • @jherbison
      @jherbison  3 роки тому

      I replied to your email. Did you get it?

  • @Daud181
    @Daud181 3 роки тому +2

    Sir now a days I am working on WordPress back up site plugin. Can you please make a video on back up plugin that how we easy create backup site plugin.

    • @jherbison
      @jherbison  3 роки тому +1

      So you want me to make the plugin for you? ;-). What do you want to do different than the other plug-ins out there don’t do?

    • @Daud181
      @Daud181 3 роки тому +1

      @@jherbison Yes sir there is multiple plugins are available for backup a wordpress site but I have to learn plugin developement so my task to create a backup plugin for WordPress
      I have confuse how to do this
      I have multiple options
      Like if a use only databases file then the images and assets folder will not Work how I download both things
      Database and wordpress file like All in one migration plugin.
      Can you please tell some major function or topic related to this

    • @jherbison
      @jherbison  3 роки тому +1

      That is a big plugin to learn on!

    • @Daud181
      @Daud181 3 роки тому +1

      @@jherbison yes sir I know but I have to done this

    • @jherbison
      @jherbison  3 роки тому +2

      Cool. Good luck.

  • @judeleon8485
    @judeleon8485 Місяць тому

    Well explained topic. However, it appears like this is the only topic on cURL. If there are others, please point me to them. Thanks

  • @Daud181
    @Daud181 3 роки тому +2

    Sir how we make Medicine bill price calculator in WordPress with code

    • @jherbison
      @jherbison  3 роки тому

      Please explain more of what you are looking for.

    • @Daud181
      @Daud181 3 роки тому +1

      @@jherbison sir recently I have done project hospital managnment system on WordPress but my client ask me please Make a form which do calacultion of purchase medicine
      Example
      If a user buy one tablet form pharmacy so the system calculate the Medicane price calculation with discount and give total amount with print slip functionality one user done they get slip of her purchase record
      And print slip record have name of hospital and address phone and note form hospital which is permant and default print on every slip

  • @adventuretime6457
    @adventuretime6457 2 роки тому

    I want to use post curl api which has been given by vendor, how can I call that in my code?

  • @andikprasetyo4049
    @andikprasetyo4049 8 місяців тому

    sorry sir, I get this error when trying to access external API: OpenSSL SSL_connect: Connection reset by peer in connection to blablabla, how do i fix it?

  • @virajsingh553
    @virajsingh553 3 роки тому +1

    My curl_exec is returning false . Can you tell me how to get my desired json file

    • @jherbison
      @jherbison  3 роки тому

      Thank you for watching and commenting.. Send me an email with your code to josh@ideapro.com you may just need to add a couple of lines in the curl to turn off verify host.
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

  • @vishvish24
    @vishvish24 2 роки тому

    How to fetch api data every second without setInterval as setinterval is just single threaded and not proper solution for this