简体   繁体   中英

show and hide div using email

I have a client that needs to de-activate or activate (show or hide) a DIV (or an alert) every now and then. He is asking if this would be possible to do on the road, without an advanced smartphone or a computer using FTP. I was wondering if maybe some script would allow him to do this by simply sending an email with username, password and command (show or hide) to an address created for this purpose.

Any suggestions?

I think this is a bit overkill for the problem, but it theoretically could work.

First you set up an email-adress and make a php-script fetch the mails through pop3. When an email containing the username, password and some sort of command arrives, it changes the page accordingly. This php-script has to be run regularily through a cronjob.

You could setup a google voice account and use something like pygooglevoice to check for incoming text messages from his\\her cellphone.

Depending on your setup you would need the webserver running some sort of smtp server to be able to retrieve emails, which is why i recommended pygooglevoice.

You could have him text an alert to the google voice number you create and have your script check every so often for new messages. For instance he could send "1 We are currently experiencing technical difficulties" to enable an alert or just "0" to disable any alert.

If you're using mysql you could create a table for alerts with a status and a message. Have your page check if the status is 1 and if so display the div.

You could also just write to a flatfile like "alert.txt" and on your page check if the file exists using ajax or php to display the message. If he sends a 0, just delete the file.

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