Send SMS Messages using PHP

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ก.ค. 2024
  • In this short PHP project, you'll learn how to send an SMS message to a mobile phone / cellphone using PHP.
    We'll use two SMS gateway providers, Infobip and Twilio, in order to compare how they work.
    All source code shown is free to download.
    Please consider supporting my channel:
    ☕ ko-fi.com/davehollingworth
    Code shown in the video:
    ‣ gist.github.com/daveh/6a31d0d...
    Links shown in the video:
    ‣ www.infobip.com/
    ‣ www.twilio.com/
    PHP packages:
    ‣ github.com/infobip/infobip-ap...
    ‣ github.com/twilio/twilio-php
    Videos:
    ‣ Securely Storing PHP Configuration Settings: • Securely Storing PHP C...
    00:00 Introduction
    00:14 SMS Gateways
    00:54 HTML Form
    01:29 Sending Script
    01:53 Infobip
    05:11 Custom sender ID
    06:06 Twilio
    08:44 SMS character limit
    09:45 Summary
    #PHP #sms #project
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 83

  • @fadelellaherrami8840
    @fadelellaherrami8840 2 หลายเดือนก่อน +1

    Dave, thank you very much for clarifying the video. Your explanation was really helpful

  • @collenzaligway4458
    @collenzaligway4458 9 หลายเดือนก่อน +1

    This is a very informative video, thank you so much Dave hope you keep making more.

  • @iam.masoudsamimi
    @iam.masoudsamimi หลายเดือนก่อน

    Awesome as always. Much appreciated.

  • @jarencefeliciano
    @jarencefeliciano 9 หลายเดือนก่อน +2

    Hi, Dave. Thank you for another short and concise tutorial. Best PHP instructor!

    • @someutubchannel69
      @someutubchannel69 9 หลายเดือนก่อน

      I have 2 courses from him on Udemy.... best $$$ invested!!!

    • @jarencefeliciano
      @jarencefeliciano 9 หลายเดือนก่อน

      @@someutubchannel69 I have 6 courses from him on Udemy too and 4 out of those courses are completed. Yes, $$$ invested!

  • @techatival
    @techatival 9 หลายเดือนก่อน +2

    This is a useful video, thank you!

  • @abbasmohamedwalaal5753
    @abbasmohamedwalaal5753 9 หลายเดือนก่อน +2

    Great video and nice explanation

  • @batchrocketproject4720
    @batchrocketproject4720 9 หลายเดือนก่อน +1

    very useful, thanks. 💯

  • @nameoftruth
    @nameoftruth 9 หลายเดือนก่อน +1

    Thank you very much boss...

  • @aogunnaike
    @aogunnaike 9 หลายเดือนก่อน +2

    Thanks alot for this

  • @prepayt3637
    @prepayt3637 7 หลายเดือนก่อน

    thankyou so much so helpful

  • @mounir101
    @mounir101 9 หลายเดือนก่อน +2

    Thanks so much for this unique lesson. Please could you make a another lesson about how to create a REST API using slimPHP framework. Keep going.

  • @dave-hollingworth
    @dave-hollingworth  9 หลายเดือนก่อน

    Source code is available here: gist.github.com/daveh/6a31d0d28d9aef8c161c6ff1b6d29fae

    • @pitularjelldaenuelc.557
      @pitularjelldaenuelc.557 3 หลายเดือนก่อน

      how do i fix this?
      Fatal error: Uncaught Error: Class "Twilio\Rest\Client" not found...

    • @dave-hollingworth
      @dave-hollingworth  3 หลายเดือนก่อน

      @@pitularjelldaenuelc.557 Make sure you've installed the packages using Composer, and included Composer's autoloader

  • @Linksdapp
    @Linksdapp 9 หลายเดือนก่อน

    I love your videos, have code a multi vendor frontend website, but i don't know backend programming to connect the frontend to the backend, I really wish you could do a video on it. I love your tutorials so easy to understand. I will be happy if you can be mentor in programming. Am Moses

  • @someutubchannel69
    @someutubchannel69 9 หลายเดือนก่อน +3

    Dave,
    Hi! ! Amazing video as always!
    Do you have a video about how to properly use composer ?
    If not, would you please create one about it?
    As always... Thank You!!!

    • @dave-hollingworth
      @dave-hollingworth  9 หลายเดือนก่อน +1

      I don't at the moment, but it's a good idea for a video, I'll make a note!

    • @someutubchannel69
      @someutubchannel69 9 หลายเดือนก่อน +1

      @@dave-hollingworth
      Thank You so much!!!

  • @shobitgupta1683
    @shobitgupta1683 25 วันที่ผ่านมา +1

    can u pls make a video on how to get OTP

  • @misternley
    @misternley 9 หลายเดือนก่อน

    Hi Dave thank you for this video. Now let's say you want to send SMSes in bulk to different recipients. For example in a school sending fees balances. The balances being fetched from a different table from the one having the phone numbers and names. By using a loop e.g foreach, do..while e.t.c the code takes a longer time to execute and therefore taking more server resources, how can one achieve the former without the latter problem.

    • @dave-hollingworth
      @dave-hollingworth  9 หลายเดือนก่อน +2

      Depending on which provider you're using, you could send several messages with one call if you build up the list of messages first. Also, with things like this, you could run it as a scheduled task when load is low on your server (e.g. at night)

  • @manosxa
    @manosxa 5 หลายเดือนก่อน

    Maybe is a stupid question or something obvious for all however I need to know where do we run the $ composer...... .Is it in the windows command by altering the location to the root of the project? It does not look like you have any location on your screen when you run it.

    • @dave-hollingworth
      @dave-hollingworth  5 หลายเดือนก่อน

      Ah sorry didn't see this comment - yes, it's on the command line, using cd to change to the project folder. As @StoryTellerZb says though, you can do it from inside VSCode if you prefer

  • @heshankanishka8316
    @heshankanishka8316 4 หลายเดือนก่อน

    Sir, please tell me about the WhatsApp business api

  • @cyriljimrylgana3243
    @cyriljimrylgana3243 2 หลายเดือนก่อน

    hi sir can you make a video that can send multiple phone numbers using those 2 api

  • @olatunjipelumi4671
    @olatunjipelumi4671 7 หลายเดือนก่อน

    Please how do i make the reciever to see the message coming from me as the sender rather than seeing rather Infobip as the sender

    • @dave-hollingworth
      @dave-hollingworth  7 หลายเดือนก่อน

      th-cam.com/video/obolAwbx388/w-d-xo.htmlsi=sSmnnJuU3CLS-jeT&t=312

  • @Tenku97
    @Tenku97 5 หลายเดือนก่อน

    how to solve Parse error: syntax error, unexpected ':', expecting ') in $configuration?

    • @dave-hollingworth
      @dave-hollingworth  5 หลายเดือนก่อน

      Probably because of named arguments - remove the names or upgrade your PHP version

  • @user-yr8jw4hm7t
    @user-yr8jw4hm7t 4 หลายเดือนก่อน

    Hello, do you have another platform you can be contacted on need help!

  • @Iamstephane
    @Iamstephane 3 หลายเดือนก่อน

    Hev Dave. Please how do I fix this error "Uncaught Error: Class "infobip\Configuration" not found" ?

    • @dave-hollingworth
      @dave-hollingworth  3 หลายเดือนก่อน

      Make sure you've installed the packages using Composer, and included Composer's autoloader

  • @abdelhamidnehlil7277
    @abdelhamidnehlil7277 9 หลายเดือนก่อน

    merci khoo #khoo = frère

  • @ShrikrupaMedia
    @ShrikrupaMedia 3 หลายเดือนก่อน

    In command prompt i got eeror composer not recognised

    • @Iamstephane
      @Iamstephane 3 หลายเดือนก่อน

      You have to first manually download the composer package from google and install on your PC before you'll be able to use composer in terminal

  • @louiscastle9448
    @louiscastle9448 4 หลายเดือนก่อน

    So i will put some code for twilio and the admin/user should download twilio too for them to receive the message?

    • @dave-hollingworth
      @dave-hollingworth  4 หลายเดือนก่อน

      No, once the message is sent, all the recipient needs is a mobile number

  • @pitularjelldaenuelc.557
    @pitularjelldaenuelc.557 3 หลายเดือนก่อน

    how do i fix this?
    Fatal error: Uncaught Error: Class "Twilio\Rest\Client" not found...

    • @dave-hollingworth
      @dave-hollingworth  3 หลายเดือนก่อน

      Make sure you've installed the packages using Composer, and included Composer's autoloader

  • @PraveenaL-kp6lk
    @PraveenaL-kp6lk 3 หลายเดือนก่อน +2

    SMS message sent in my site but didn't receive to my mobile

  • @terrybus1
    @terrybus1 4 หลายเดือนก่อน

    Hello Dave, this video on php sms is great, however I.m having an issue with the line..."$configuration = new Configuration(host: $base_url apiKey: $api_key);" The error is Syntax error, unexpected ':' , expecting ',' or ')'

    • @dave-hollingworth
      @dave-hollingworth  4 หลายเดือนก่อน

      This is because you're using an older version of PHP that doesn't support named arguments. You can upgrade PHP (recommended) or remove the argument names (the "host:" etc. parts)

  • @stanleyuche8272
    @stanleyuche8272 หลายเดือนก่อน

    your video is simplified thank you so much but am finding it hard to upgrade my twillio account. please kindly assist

    • @dave-hollingworth
      @dave-hollingworth  หลายเดือนก่อน

      Please try contacting Twilio support for help with those accounts

  • @user-rb2ix9vr9s
    @user-rb2ix9vr9s 8 หลายเดือนก่อน

    Master, good afternoon, i make all steps, fisrt time from install using composer and after i try to copy directly two projects, but not work. Can i send my code by mail to helpme please??? i need that this work to a litlle web project

  • @AjayBhardwaj-iu7th
    @AjayBhardwaj-iu7th 21 วันที่ผ่านมา

    Hi Dave,
    how i integrate this thing with wordpress?

    • @dave-hollingworth
      @dave-hollingworth  20 วันที่ผ่านมา +1

      I'm afraid I'm not familiar with WordPress integrations - try seeing if there are any WP extensions that do this

  • @edwardklem7718
    @edwardklem7718 7 หลายเดือนก่อน

    Its saying message sent but not seeing anything on my phone. No received messages

    • @dave-hollingworth
      @dave-hollingworth  7 หลายเดือนก่อน

      Check the logs in the provider's dashboard, see if it says anything there

  • @salakopaul8755
    @salakopaul8755 5 หลายเดือนก่อน

    Thank you for this great video, My Info worked but for TWILO i'm having issues at the $twilio_number = "+ "; area, i dont know hwere to get the number to input there
    And for INFO, how can i send to more than one contacts?

    • @dave-hollingworth
      @dave-hollingworth  4 หลายเดือนก่อน

      The number is in the Twilio console, where there are also code samples to do different things

  • @calvinmubata1831
    @calvinmubata1831 6 หลายเดือนก่อน +1

    On $configuration its giving an error, unexpected ':', expecting ')😇'

    • @Tenku97
      @Tenku97 5 หลายเดือนก่อน

      how to fix this?

  • @Crank-nn2ub
    @Crank-nn2ub หลายเดือนก่อน

    Dave excuse my lack of intelligence but please can you kindly explain what your using exactly to write the code? Is that a program? Is that a OS?

    • @dave-hollingworth
      @dave-hollingworth  หลายเดือนก่อน

      It's a code editor, Visual Studio Code. It's free, you can get it here: code.visualstudio.com/

    • @Crank-nn2ub
      @Crank-nn2ub หลายเดือนก่อน

      @@dave-hollingworth Dave, I have spent the last two days studying this video. I have followed every single step and done this multiple times. I’m still having a silly error encountered on my side. I’m surely making a small mistake but I can’t seem to figure out where.
      Please take my request seriously I am more than happy to pay you upfront for a quick 10 or 15 minutes chat. Maybe you can help me where I am going wrong…..
      I will pay you upfront, so you know I am not messing around please can you reply to this comment with a handle i can contact you on such as telegram or whatever you prefer.
      Sir, I know you get a lot of comments on your videos of people asking you for help but hopefully you’re happy to help me where I am willing to pay for your time. I will pay first so you know I’m serious. Any crypto you like :)

  • @drumbeatsnation1563
    @drumbeatsnation1563 8 หลายเดือนก่อน

    will it still works in localhost when i use free or i buy subscription?

    • @dave-hollingworth
      @dave-hollingworth  8 หลายเดือนก่อน +1

      Yes it will still work on localhost

    • @drumbeatsnation1563
      @drumbeatsnation1563 8 หลายเดือนก่อน

      @@dave-hollingworth i tried the free version of twilio, it has logs in my message log in twillio account and says its delivered but i didn't receive any message in my phone number until now, i use php.. can you help me why?

  • @miraclemissionmw
    @miraclemissionmw 4 หลายเดือนก่อน

    Im getting an error that says class infobip\api\smsApi not found , how can i best fix this

    • @dave-hollingworth
      @dave-hollingworth  4 หลายเดือนก่อน

      Check you're including Composer's autoloader, and that the namespaces and classnames have the correct case

    • @miraclemissionmw
      @miraclemissionmw 4 หลายเดือนก่อน

      @@dave-hollingworth solved thanks, thou I can't add multiple recipients for the number under infobip as it only allow me to register one recipient
      Great tutorial by the way 👏

    • @Iamstephane
      @Iamstephane 3 หลายเดือนก่อน

      Bro please how did you fix this error "Uncaught Error: Class "infobip\Configuration" not found"? I get it when using infobip@@miraclemissionmw

  • @BahasictTv
    @BahasictTv 8 หลายเดือนก่อน

    I try it on my server but not working ( This page isn't working...)😢

  • @terrybus1
    @terrybus1 4 หลายเดือนก่อน

    i am using php 8.2...am i missing something?

    • @dave-hollingworth
      @dave-hollingworth  4 หลายเดือนก่อน

      If it works when you remove the argument names, then it would seem that your web server is using an earlier version of PHP (it's possible that you could have several versions installed, or the command-line version is different to the web server version)

  • @user93464
    @user93464 9 หลายเดือนก่อน

    How to sent message on Viber and WhatsApp?

    • @dave-hollingworth
      @dave-hollingworth  9 หลายเดือนก่อน +1

      Both providers shown in the video have an API for WhatsApp, check out their websites for more details

    • @user93464
      @user93464 9 หลายเดือนก่อน +1

      @@dave-hollingworth Thank you!

  • @zooey-Chou
    @zooey-Chou 20 วันที่ผ่านมา

    hello

  • @YoutubeP-vn1de
    @YoutubeP-vn1de 2 หลายเดือนก่อน

    Can you help me bro to fix my script I will pay for it bro it’s important for me

    • @dave-hollingworth
      @dave-hollingworth  2 หลายเดือนก่อน

      I'm afraid I don't do any consulting work at the moment, but if it's a simple question please feel free to post the details and I'll have a look

    • @YoutubeP-vn1de
      @YoutubeP-vn1de 2 หลายเดือนก่อน

      @@dave-hollingworth it’s very simple sir for you I have scripts you just need to edit something and it’s important for me I will be happy if you help me the problem is script not showing anything it’s blank after host same script working befor but suddenly I don’t know what happened started showing blank page
      Please can share me your Instagram telegram or mail anything so I can send you files so you can check

  • @wellkin
    @wellkin 8 หลายเดือนก่อน

    Is that free?

    • @dave-hollingworth
      @dave-hollingworth  8 หลายเดือนก่อน

      Both providers give you a few messages for free when you create an account, but generally sending SMS messages costs per message.