No video

Send SMS Messages using PHP

  Рет қаралды 30,433

Dave Hollingworth

Dave Hollingworth

Күн бұрын

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/dave...
Code shown in the video:
‣ gist.github.co...
Links shown in the video:
‣ www.infobip.com/
‣ www.twilio.com/
PHP packages:
‣ github.com/inf...
‣ github.com/twi...
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

Пікірлер: 89
@dave-hollingworth
@dave-hollingworth 10 ай бұрын
Source code is available here: gist.github.com/daveh/6a31d0d28d9aef8c161c6ff1b6d29fae
@pitularjelldaenuelc.557
@pitularjelldaenuelc.557 4 ай бұрын
how do i fix this? Fatal error: Uncaught Error: Class "Twilio\Rest\Client" not found...
@dave-hollingworth
@dave-hollingworth 4 ай бұрын
@@pitularjelldaenuelc.557 Make sure you've installed the packages using Composer, and included Composer's autoloader
@jarencefeliciano
@jarencefeliciano 10 ай бұрын
Hi, Dave. Thank you for another short and concise tutorial. Best PHP instructor!
@someutubchannel69
@someutubchannel69 10 ай бұрын
I have 2 courses from him on Udemy.... best $$$ invested!!!
@jarencefeliciano
@jarencefeliciano 10 ай бұрын
@@someutubchannel69 I have 6 courses from him on Udemy too and 4 out of those courses are completed. Yes, $$$ invested!
@fadelellaherrami8840
@fadelellaherrami8840 3 ай бұрын
Dave, thank you very much for clarifying the video. Your explanation was really helpful
@mounir101
@mounir101 10 ай бұрын
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.
@collenzaligway4458
@collenzaligway4458 10 ай бұрын
This is a very informative video, thank you so much Dave hope you keep making more.
@davidli7133
@davidli7133 18 күн бұрын
Thank you for your video. It's really work well.
@someutubchannel69
@someutubchannel69 10 ай бұрын
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 10 ай бұрын
I don't at the moment, but it's a good idea for a video, I'll make a note!
@someutubchannel69
@someutubchannel69 10 ай бұрын
@@dave-hollingworth Thank You so much!!!
@iam.masoudsamimi
@iam.masoudsamimi 2 ай бұрын
Awesome as always. Much appreciated.
@abbasmohamedwalaal5753
@abbasmohamedwalaal5753 10 ай бұрын
Great video and nice explanation
@techatival
@techatival 10 ай бұрын
This is a useful video, thank you!
@shobitgupta1683
@shobitgupta1683 2 ай бұрын
can u pls make a video on how to get OTP
@aogunnaike
@aogunnaike 10 ай бұрын
Thanks alot for this
@batchrocketproject4720
@batchrocketproject4720 10 ай бұрын
very useful, thanks. 💯
@nameoftruth
@nameoftruth 10 ай бұрын
Thank you very much boss...
@PraveenaL-kp6lk
@PraveenaL-kp6lk 4 ай бұрын
SMS message sent in my site but didn't receive to my mobile
@nerajaksharaju3533
@nerajaksharaju3533 3 ай бұрын
Did you resolve the issue?
@Linksdapp
@Linksdapp 10 ай бұрын
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
@urbarsreedas8756
@urbarsreedas8756 6 күн бұрын
i want to send messages without cost , if possible ?? Please suggest mee
@christianstephen6145
@christianstephen6145 Ай бұрын
thanks it worked
@calvinmubata1831
@calvinmubata1831 8 ай бұрын
On $configuration its giving an error, unexpected ':', expecting ')😇'
@Tenku97
@Tenku97 6 ай бұрын
how to fix this?
@stanleyuche8272
@stanleyuche8272 2 ай бұрын
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 2 ай бұрын
Please try contacting Twilio support for help with those accounts
@prepayt3637
@prepayt3637 8 ай бұрын
thankyou so much so helpful
@daily-motivation-24
@daily-motivation-24 17 күн бұрын
can we send bulk sms ?
@misternley
@misternley 10 ай бұрын
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 10 ай бұрын
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)
@cyriljimrylgana3243
@cyriljimrylgana3243 3 ай бұрын
hi sir can you make a video that can send multiple phone numbers using those 2 api
@manosxa
@manosxa 7 ай бұрын
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 6 ай бұрын
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
@terrybus1
@terrybus1 6 ай бұрын
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 6 ай бұрын
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)
@pitularjelldaenuelc.557
@pitularjelldaenuelc.557 4 ай бұрын
how do i fix this? Fatal error: Uncaught Error: Class "Twilio\Rest\Client" not found...
@dave-hollingworth
@dave-hollingworth 4 ай бұрын
Make sure you've installed the packages using Composer, and included Composer's autoloader
@Iamstephane
@Iamstephane 4 ай бұрын
Hev Dave. Please how do I fix this error "Uncaught Error: Class "infobip\Configuration" not found" ?
@dave-hollingworth
@dave-hollingworth 4 ай бұрын
Make sure you've installed the packages using Composer, and included Composer's autoloader
@Tenku97
@Tenku97 6 ай бұрын
how to solve Parse error: syntax error, unexpected ':', expecting ') in $configuration?
@dave-hollingworth
@dave-hollingworth 6 ай бұрын
Probably because of named arguments - remove the names or upgrade your PHP version
@heshankanishka8316
@heshankanishka8316 5 ай бұрын
Sir, please tell me about the WhatsApp business api
@Crank-nn2ub
@Crank-nn2ub 3 ай бұрын
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 3 ай бұрын
It's a code editor, Visual Studio Code. It's free, you can get it here: code.visualstudio.com/
@Crank-nn2ub
@Crank-nn2ub 3 ай бұрын
@@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 :)
@olatunjipelumi4671
@olatunjipelumi4671 9 ай бұрын
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 9 ай бұрын
kzfaq.info/get/bejne/pcifn6Sox96XaGw.htmlsi=sSmnnJuU3CLS-jeT&t=312
@AjayBhardwaj-iu7th
@AjayBhardwaj-iu7th 2 ай бұрын
Hi Dave, how i integrate this thing with wordpress?
@dave-hollingworth
@dave-hollingworth 2 ай бұрын
I'm afraid I'm not familiar with WordPress integrations - try seeing if there are any WP extensions that do this
@user-rb2ix9vr9s
@user-rb2ix9vr9s 9 ай бұрын
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
@dave-hollingworth
@dave-hollingworth 9 ай бұрын
Try putting it on GitHub
@louiscastle9448
@louiscastle9448 6 ай бұрын
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 6 ай бұрын
No, once the message is sent, all the recipient needs is a mobile number
@salakopaul8755
@salakopaul8755 6 ай бұрын
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 6 ай бұрын
The number is in the Twilio console, where there are also code samples to do different things
@user-yr8jw4hm7t
@user-yr8jw4hm7t 6 ай бұрын
Hello, do you have another platform you can be contacted on need help!
@ShrikrupaMedia
@ShrikrupaMedia 5 ай бұрын
In command prompt i got eeror composer not recognised
@Iamstephane
@Iamstephane 4 ай бұрын
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
@edwardklem7718
@edwardklem7718 8 ай бұрын
Its saying message sent but not seeing anything on my phone. No received messages
@dave-hollingworth
@dave-hollingworth 8 ай бұрын
Check the logs in the provider's dashboard, see if it says anything there
@miraclemissionmw
@miraclemissionmw 5 ай бұрын
Im getting an error that says class infobip\api\smsApi not found , how can i best fix this
@dave-hollingworth
@dave-hollingworth 5 ай бұрын
Check you're including Composer's autoloader, and that the namespaces and classnames have the correct case
@miraclemissionmw
@miraclemissionmw 5 ай бұрын
@@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 4 ай бұрын
Bro please how did you fix this error "Uncaught Error: Class "infobip\Configuration" not found"? I get it when using infobip@@miraclemissionmw
@drumbeatsnation1563
@drumbeatsnation1563 9 ай бұрын
will it still works in localhost when i use free or i buy subscription?
@dave-hollingworth
@dave-hollingworth 9 ай бұрын
Yes it will still work on localhost
@drumbeatsnation1563
@drumbeatsnation1563 9 ай бұрын
@@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?
@terrybus1
@terrybus1 6 ай бұрын
i am using php 8.2...am i missing something?
@dave-hollingworth
@dave-hollingworth 6 ай бұрын
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)
@abdelhamidnehlil7277
@abdelhamidnehlil7277 10 ай бұрын
merci khoo #khoo = frère
@user93464
@user93464 10 ай бұрын
How to sent message on Viber and WhatsApp?
@dave-hollingworth
@dave-hollingworth 10 ай бұрын
Both providers shown in the video have an API for WhatsApp, check out their websites for more details
@user93464
@user93464 10 ай бұрын
@@dave-hollingworth Thank you!
@YoutubeP-vn1de
@YoutubeP-vn1de 3 ай бұрын
Can you help me bro to fix my script I will pay for it bro it’s important for me
@dave-hollingworth
@dave-hollingworth 3 ай бұрын
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 3 ай бұрын
@@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 10 ай бұрын
Is that free?
@dave-hollingworth
@dave-hollingworth 10 ай бұрын
Both providers give you a few messages for free when you create an account, but generally sending SMS messages costs per message.
@urbarsreedas8756
@urbarsreedas8756 6 күн бұрын
​@@dave-hollingworth how much ???
@dave-hollingworth
@dave-hollingworth 5 күн бұрын
@@urbarsreedas8756 Please check out the individual sites for their specific pricing details.
@BahasictTv
@BahasictTv 9 ай бұрын
I try it on my server but not working ( This page isn't working...)😢
Securely Storing PHP Configuration Settings
7:20
Dave Hollingworth
Рет қаралды 6 М.
Difference between cookies, session and tokens
11:53
Valentin Despa
Рет қаралды 614 М.
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 9 МЛН
小蚂蚁被感动了!火影忍者 #佐助 #家庭
00:54
火影忍者一家
Рет қаралды 52 МЛН
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 20 МЛН
Send email with PHP | Create a Working Contact Form Using PHP
10:18
Dave Hollingworth
Рет қаралды 134 М.
Send SMS Via API Integration using PHP
10:32
CodeFlix
Рет қаралды 51 М.
[TAGALOG] SMS Gateway API Tutorial
32:05
PinoyFreeCoder
Рет қаралды 13 М.
Sending OTP SMS in PHP from localhost using textlocal
14:30
learnWebCoding
Рет қаралды 167 М.
How to send Bulky SMS using PHP
17:14
Codestar Technologies
Рет қаралды 7 М.
Generate a PDF with PHP
19:17
Dave Hollingworth
Рет қаралды 59 М.
Use Composer to Easily Manage PHP Packages
15:40
Dave Hollingworth
Рет қаралды 3,8 М.
REST API with PHP and MySQL | Full Slim PHP Micro Framework Tutorial
50:01
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 9 МЛН