SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,292
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    silly not to store contact form submissions in db as well as sending?

    hi,

    is there any reason i should store data submitted to a contact form, that's emailed to whose site it is, in a database.

    storing it as well as sending it is what i've done on another site but it's pretty much turned out to be a waste of time i think.

    i suppose there's more chance of an email submission going wrong temporarily than a database storage command, so storing is probably a bit more reliable (is that correct?). but then nobody is going to check the database entries with the emails they've received to see if there's any that are stored but not received i don't think, unless there's an easy way to do that.

    nothing wrong with not storing contact page submissions in a database?

    thanks.

  2. #2
    SitePoint Zealot
    Join Date
    Nov 2005
    Location
    Nashville, TN
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your never going to do anything with the data why store it?

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,292
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    yes i know. i suppose what i'm trying to get at is how reliable/unreliable is mail() (assuming correct info)? how likely is it or the general email system to fail? emails do go astray sometimes don't they? do other people store their form submission data as well as send it for some reason? if so what then? can i rely on mail()?

  4. #4
    SitePoint Zealot
    Join Date
    Nov 2005
    Location
    Nashville, TN
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use PHPmailer Class http://phpmailer.sourceforge.net/ and never have a problem, it will tell you if there is an error sending and maybe you could just record those in the db?

  5. #5
    SitePoint Addict pkSML's Avatar
    Join Date
    Aug 2006
    Location
    Ohio
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not a bad idea!

    I think the mail server is what you need to consider for mail()'s stability.

    Personally, I have a localhost mailserver, which does go down sometimes. So this may be a good option for me. If I did implement the idea, I'd have a PHP script to show me when the most recent entry (or entries) was sent, and a way to access the messages.

    If you're using a hosting plan with your web host, I wouldn't worry about it. They're very stable.
    -Stephen

    Get a LitlURL to this page!

  6. #6
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Why not just store the last weeks form submissions, that way if you get mail problems you can alway retrieve the last weeks data from the DB.

    Just a thought
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  7. #7
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,292
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmm001 View Post
    I use PHPmailer Class http://phpmailer.sourceforge.net/ and never have a problem, it will tell you if there is an error sending and maybe you could just record those in the db?
    right. i might look into that. thanks. mail() tells you if there's an error or not though. from the manual:

    Return Values

    Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.

    It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.
    not sure if PGPmailer is better than that in some way.

    if that happens, with the way i've done the contact page, the visitor/user will also see an error so they'll know their message hasn't gone. but there's obviously further other errors that can happen though.

    recording errors, with the submitted info, is quite a good idea. might do that. thanks.

    Quote Originally Posted by pkSML View Post
    Personally, I have a localhost mailserver, which does go down sometimes. So this may be a good option for me.
    the recording of errors might be a good option, or using PHPmailer might be a good option?

  8. #8
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    Southwest Florida
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I generally store them. I've never had a a problem with the mail not actually being sent -- but a couple times I've had clients who accidentally deleted an e-mail. They were quite happy that I was able to retrieve it for them.

  9. #9
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    While an email might be successfully sent a spam filter could get in the way, or it may just get overlooked at its destination, or data could get lost on the server before it's downloaded, or .....

    If you have the time I'd probably store the content as well (perhaps for a limited time) and then once a week email a summary of contact submissions (sender and subject) to the site owner. They can peruse the list and if any didn't arrive the info can be retrieved from the database.

    Depending on the nature of the client and the messages, and frequency of form use this may not always be a good solution. Just use your judgement.

  10. #10
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 Post(s)
    Tagged
    3 Thread(s)
    A database uses such a piffling amount of space to store an email, you might as well just store them and not worry about it. It doesn't matter that you may not look at it for months, but the one occassion where something goes wrong you can drop into smug mode and get the emails back

    It's the same principle I have when it comes to deleting records from a database - I dont.
    I have a column called 'visible' with a flag 0 or 1. When the user hits delete it sets the value to 0 ergo, not visible.

    How many times do you think - "I wish I hadn't deleted that"?
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  11. #11
    _ silver trophy ses5909's Avatar
    Join Date
    Jul 2003
    Location
    NoVa
    Posts
    5,467
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I agree with Spike. I love data and the amount of work it would take to store the contact info in the DB is tiny. I would go for it.
    Sara


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •