treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Php post question

  • I am trying to figure how to post text to a site using a php form but I want the text to stay there and not leave when you reload the page. I found this article but it's not exactly what I'm looking for it posts it and leaves when you reload the page. I hope you understand what I am talking about. Thanks in advance.
  • How long do you want the text to stay there for?

    If it's a permanent thing then you'll need to look at either storing the data in a database, or storing it in a text file.

    Otherwise, if it just has to be there until they leave the site, look at $_SESSION storage
  • They will need to be on their different times some up to a couple of months what do you think is the best way?
  • Ok, so session is not the right way to go.

    Does everyone need to be able to see the content or is it just limited to the user? Is it critical the content remains in place or does it just mean the user has to fill in a form again if they clear it off?
  • Yes everybody needs to see the content. Actually this is for a client who needs to post baby and bridal registries to a site without me having to code them manually. And I would like them to be able to remove them without me having to do it also but that's probably a whole different situation.
  • Database is your best way forward then. Probably MySQL.
  • Do you know of an article somewhere, close to what I am trying to do?
  • That depends. Do you know anything about databases? Does your hosting provider give you access to a MySQL database?

    If not, then maybe for now take a look at reading and writing files. I've always liked the tutorials on http://www.tizag.com/phpT/files.php
  • I don't think I know anything about databases and I am with media temple so I'm pretty sure I have access to MySQL.