Closed Thread Icon

Topic awaiting preservation: update webpage via email or SMS? Pages that link to <a href="https://ozoneasylum.com/backlink?for=31938" title="Pages that link to Topic awaiting preservation: update webpage via email or SMS?" rel="nofollow" >Topic awaiting preservation: update webpage via email or SMS?\

 
Author Thread
CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 08-04-2010 00:59

We have a website for our Mountain Biking ground and my buddy that owns it would like to change the status on a couple certain fields via email or SMS. These changes will be if the trail is OPEN or CLOSED. There are currently 7 trails.

To use SMS, it seems you would have to go through an SMS gateway so I am thinking that will be out. So I am thinking of using email.

PHP will let you use IMAP and has a few features. There are some PHP-IMAP classes that I have found that will let you grab emails and work with them to some extent.

What I was aiming to do was have the emails come in and read the subject line to determine which element needs to be changed, then read the message of the body to determine what the change is. This will be "OPEN" or "CLOSED" plus it will change the background colors. So the Subject of the email may be "TRAIL 1" and the body would say "OPEN". The website would get the email and change the status of the trail.

I can see a few security holes creeping into this so that is why I am here. Is there a better way to do this rather than use PHP. That is what I am most comfortable with using, that's why I chose that. I would like to make sure that the script only accepts emails from one certain email address and everything else is rejected. This might be able to be handled via the website when the email is set up. Not sure.

So that is my question I guess. What is a good approach to this? He doesn't want some "admin" feature on the site, he is wanting to do this via his Blackberry. He has email on it so that was what I thought of first. Just send an email to the script, have it read it and change the status of the page. Am I on the right track?

Thanks in advance!
C:\

Later,

C:\

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 08-04-2010 10:47

yeah, cronjob, check email, modify data will work.
Seem to remember you can also send sms to email adresses given the right gateway (eats into the 160 char limit though).

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 08-04-2010 15:11

well cool. I'll work on doing that then. I was thinking of having the info in a database and just have the email change the data in the database.

As for the SMS to email, you are right. It does require an SMS gateway and the hosting company won't allow that as far as I can tell. Not sure if I'm asking the right questions to them but it fell pretty fast. As for the the 160 char limit, that wouldn't be an issue since the only thing in the message would be "OPEN" or "CLOSED"

Later,

C:\

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 08-05-2010 01:38

I don't know if you have procmail available on your host, but I did this once a few years ago for a site that wanted to be able to call soccer games based on field/weather conditions, with an email sent from a mobile phone. I piped the email to a perl script that used Mail::Internet at cpan.org to check the body of the email for the words "rain" or "shine" and if found wrote it to a text file. When someone visited the site, the code would check that file and display accordingly.

- Butcher -

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 08-05-2010 02:04

butcher,

That is pretty much exactly what I will be doing except with PHP. Not sure about procmail but I will check on it.

Thanks for the info!

Later,

C:\

Tao
Maniac (V) Inmate

From: The Pool Of Life
Insane since: Nov 2003

posted posted 08-05-2010 02:26

Crikey!!!!
I love the way our venerable veteran Asylumites turn up out of the blue.......Erm, orange.

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 08-05-2010 02:47

CPrompt

The procmail bit would just alleviate the need for a cron as you can parse the emails as they come in.


Tao

You know this place is like the Hotel California, you may check out, but you never leave.

- Butcher -

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 08-05-2010 11:45

that sms to email gateway would be a feature of the mobile phone service provider, not your hosting.

« BackwardsOnwards »

Show Forum Drop Down Menu