Mobile phone picture on to website

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Wardy7
Forum Commoner
Posts: 38
Joined: Wed Aug 24, 2005 4:45 am
Location: UK

Mobile phone picture on to website

Post by Wardy7 »

Hi there everyone, hope you are all OK?!
I'm after abit of help if anyone is able to...

I'm after knowing if anyone knows of a way to make it so users can send a picture they have taken on their mobile phone and send it to the site so it can be displayed on it.
I'm unsure how it can be done although I'm guessing thata script that can check emails to see if there is one with an attachment and then pull the picture from it is goign to be part of the process?
The picture (MMS) is going to have to be sent from the mobile to a specified email address and then script run say every hour to be taken to databse and then to site.

This is too complicated for me to do so if anyone can help or point me in the right direction I'd be very gratefull!

Ccheers
Wardy
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

for the email stuff i think php mailer can do that for you
http://phpmailer.sourceforge.net/

then it would be simple to use getimagesize(); to make sure that the attachment is a picture then copy() that to a folder on your website then just run a quick query to update your table with the path to the new image and whatever else.

use a cron job for linux or scheduled task for windows to get this script to run once every hour or whatnot.

all in all this sounds like a really cool project - good luck
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Im was looking to do this a few months ago, but didn't really find anything for my needs. Only paid services did what i wanted
Wardy7
Forum Commoner
Posts: 38
Joined: Wed Aug 24, 2005 4:45 am
Location: UK

Post by Wardy7 »

Wow guys, how quick for the replys there?! :D

Will take a look at the site you sent and see what I can find, and also take a look at sorting out the getimages and that sort of stuff too :)

Cheers
Wardy
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Flickr take emails from mobiles and displays them on site, so it is possible.
Last edited by Grim... on Wed Aug 24, 2005 5:53 am, edited 1 time in total.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

it does not sound like it would be too hard, the hardest part would be opening emails and checking for a attachment wouldnt it?
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Yeah, I'm intrigued by this, and working on it right now.

Getting POP3 emails is a bitch :(
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Note: MMS phones save pictures with a header in front of the JPG info that GD quite often complains about.
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

This page should help you out lots:
http://www.linuxscope.net/articles/mail ... tsPHP.html
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Oh, and $username isn't your 'username', it's your whole email address.
Wardy7
Forum Commoner
Posts: 38
Joined: Wed Aug 24, 2005 4:45 am
Location: UK

Post by Wardy7 »

Jee wizz, I never expected so much help in so little time. Amazing guys, thanks! :D

Grim...I'm lookign through that now, ta :)

Cheers
Wardy
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Grim... wrote:Yeah, I'm intrigued by this, and working on it right now.

Getting POP3 emails is a bitch :(
No it's not. I have a POP3 email checker that is under 25 lines.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Sami wrote:
Grim... wrote:Yeah, I'm intrigued by this, and working on it right now.

Getting POP3 emails is a bitch :(
No it's not. I have a POP3 email checker that is under 25 lines.
Yep, there are a whole host of functions built into PHP for this.... The IMAP functions will works with POP3 and IMAP4 ;)
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Yeah, I hit refresh on my script right after I posted that and 'ping' :)

I've now finished my script, basically it takes an email from a user with an image attached, resizes and saves the image, takes the subject as the images title and the body as the images description.

Awesome ;)
Wardy7
Forum Commoner
Posts: 38
Joined: Wed Aug 24, 2005 4:45 am
Location: UK

Post by Wardy7 »

Grim... wrote:Yeah, I hit refresh on my script right after I posted that and 'ping' :)

I've now finished my script, basically it takes an email from a user with an image attached, resizes and saves the image, takes the subject as the images title and the body as the images description.

Awesome ;)
You've just done all of that Grim?
Does it work with webmail based programs too?

By any chance would you mind sharing it or I could pay you for it if you like?

Cheers
Wardy
Post Reply