简体   繁体   中英

Database change via SMS (twilio?)

So I've got a web application, let's say with 2 sub domains a.domain.com and b.domain.com

If there is an update on " a " -they currently get an email, and have to sign in to the website and do something. Is there a way (maybe through Twilio??) that I could do this via SMS?

Basically:

1 - There's a user update to " a.subdomain.com "

2 - The 'owner' of " a " gets an SMS asking for 'yes' or 'no' (the sms could be sent via PHP, or twilio perhaps?)

3 - The 'owner' replys 'yes' and This happens. if they reply 'no', nothing happens.

this is essentially a MySQL database change, changing a pst_stt to one of three values, and pst_dte to PHP's date(Ymd) function.

I know I can send the text via SMS.

Is there a way to RECEIVE and do something if it's received? All without " b .domain.com" being affected? something like, " a " set's their phone number to be '555-5555'. That number get's a text asking yes or no. They send yes ->

$text = (((the reply text received)));
$sender = (((the senders phone number)));
$phone = option('phone_number', 'options-page');

if($text == 'yes' && $sender === $phone){
    /*Do the simple Database update*/
}

I don't believe there is a way to receive SMS via php... so would something like Twilio do what I need?

You can do it with SMSIfied . They have a PHP library on GitHub that simplifies using their REST API with PHP. They show an example on receiving a text message with PHP on the GitHub home page.

Twillio makes it really easy to do this. You can look at their example pages. Its a pretty fantastic service. You can also send text messages for free to phones if you know their service provider. You just email thenumber@provider.com. Sometimes its @txt.provider.com.

Twilio can provide you with a telephone number to receive SMS messages.

So the user would reply to the SMS which your application will then process.

If you look at the guides on Twilio it should help you get a better idea:

https://www.twilio.com/docs/howto/sms-notifications-and-alerts

https://www.twilio.com/docs/quickstart

https://www.twilio.com/docs/quickstart/php/sms/hello-monkey

https://www.twilio.com/sms

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM