How To Capture Info From An Online Form In A Database?

Discussion in 'Databases' started by natwhit, Jul 2, 2012.

  1. #1
    I composed an html form. I want to capture the info entered into it in a database & also send that info to my email.

    The form processing script that I am talks of using a CSV database. My webhost uses MySQL. In the instructions it says that to direct the info to my CSV database, I should edit one line like this:
    $CSVDIR = "/home/mysite/csvdir";

    I created a csv table in my MySQL database & wrote that line in the form processing script as
    $CSVDIR = "localhost/user_mysqldatabasename";

    There seems to a problem with the table. It says "no index defined". It offers a way to make an index, but I don't understand what I'm doing.

    Anyway, the line of code above doesn't work. Is that because the form processing script is incompatible with MySQL? Or is the table not set up right? Or do I need to write that line differently? Or is there another, simpler way of doing this?

    Are there any form processing scripts that would work better? Or is there some form making software that will take care of all of this? Thanks.
     
    natwhit, Jul 2, 2012 IP
  2. charmtolucky

    charmtolucky Member

    Messages:
    293
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    35
    #2
    yeah, you can collect the same using Google Form and other free online form creator. Same you can use from Zoho form!!
     
    charmtolucky, Jul 11, 2012 IP
  3. khalonn

    khalonn Greenhorn

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    The best way of doing that is writing the information to MySQL database directly.
     
    khalonn, Aug 9, 2012 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    You can save data in a csv file, or you can save data in a database. You can't save data in a "csv table" - the term doesn't mean anything.

    Depending on the code you have, you either have to create a table in the database that has the required fields, or you have to point the constant $CSVDIR to an existing directory (folder) on the server. ($CSVCIR is a directory, not a table in a database.) There should be comments in the code to tell you what to do. (If there aren't, it's not a very well-thought-out script.)
     
    Rukbat, Aug 10, 2012 IP