Click to See Complete Forum and Search --> : Updating a Page Via e-mail


blutter
01-20-2007, 08:26 PM
I don't know anything about PHP yet, but I figure this would be the only way to do what I want. I was wondering if it's even possible to have a small form or div or something on a site that you can send an e-mail to a "secret" address and have that field update. Just text, nothing fancy, I just want to be able to e-mail "I'm in Colorado right now" or something, and have that show up on the site in a specific place.

intrivious
01-20-2007, 08:58 PM
I guess this could be possible, but not through entirely PHP. You would need the help of some other scripts on your server. I would be careful about doing this. You would need some sort of authentication so that you knew for a fact that the email you send it is from you (or anyone else who needs access) and no one else.

NightShift58
01-20-2007, 09:55 PM
This is not a direct answer to your question but it may be relevant. You decide...

To send an email, you would obviously have to have some internet access. and if you have internet access, the easiest and safest option would be to call up a PHP script that would do this for you.

It could be done by mail, sure, but it would be a daunting task, requiring access to a number of resources on you server - which you may not have. It wouldn't be the kind of initial PHP project that I would recommend to learn PHP.

blutter
01-20-2007, 10:35 PM
I don't really care about authenticating that it's actually me sending the e-mail because it's just a personal website, so if a friend of mine got the e-mail and put "Kyle is out having gay sex right now" it wouldn't really bother me. About the internet access, I was thinking just an e-mail in general, for example, even a cell phone can text to an e-mail address, which I would want to do. So I'm guessing nothing like this has come up before then?

NightShift58
01-20-2007, 10:44 PM
I don't know if it's come up in this forum before but I know there are commercial content management systems that allow email updates.

Nonetheless, it may be a little bit beyond the scope of a forum such as this one.

The basic steps would be:
Send a mail to a predefined email address.
Have a PHP IMAP or socket script run at regular intervals to check if new mails have come in (access server for CRON or similar feature)
If the right kind of email has arrived, process it and update database content

blutter
01-20-2007, 11:20 PM
Wow, I didn't think this would be so in depth. I am right though in that this would be a server side script that would have to run, right?

NightShift58
01-20-2007, 11:45 PM
Yes, it would be. And you don't really need a CRON feature, although I said otherwise earlier. The inbox "checker" could be started whenever someone called up he page where you would want to display the updated information.

mergemedia
01-21-2007, 12:22 AM
don't use an inbox at all, use a procmail script to pipe the incoming email into your other scripts.

blutter
01-21-2007, 12:24 AM
Hey, check it out:http://www.flexwindow.com/index.html
Since I'm only do this for personal use and didn't need anything fancy I used the freeversion at this website. Pretty awesome, it works and updates almost the instant the e-mail is sent.

NightShift58
01-21-2007, 12:51 AM
We're miles away from PHP and it's a remotely hosted service...

Still, it's pretty nifty!

blutter
01-21-2007, 12:53 AM
Yeah, I really would like something for my own server that there is more control of, this doesn't work with cell phone texts cause you have to use a subject line and cause you can only send from the address you register with, which I guess you could make your phone e-mail, but still, not quite flexible enough, but I'll go with it for now.

NightShift58
01-21-2007, 01:10 AM
See this manual page for examples on how to query your mail server... That would be the start...