Menu

Adding File type database

Help
Jay
2009-02-11
2013-06-03
  • Jay

    Jay - 2009-02-11

    I created a form with 50 entries etc.. but I forgot to click the "Generate file-based database" check box. Is there a way to enable this on my form?

    Thanks a million!

     
    • Jay

      Jay - 2009-02-11

      I cerated a test form and found that in the process.php there are a few lines of code added to the Forms with "File-based database" enabled.

      CODE:

      $make=fopen("admin/data.dat","a");
      $to_put="";
      $to_put .= $withfile."|".$withfiledata."
      ";
      fwrite($make,$to_put);

      <--This is found just after the mail(email@aol.com.... function

      Now i added that to my original Form but it still didn't work. I assume I have to make some edits elsewhere also, am i right?

       
      • TNTEverett

        TNTEverett - 2009-02-11

        The file must already exist as you are appending (fopen("admin/data.dat","a");) to the file.  The file must also have a header using the same syntax.  The header has the field descriptions being stored in the db. 

         
    • TNTEverett

      TNTEverett - 2009-02-11

      What version are you using? What did you check for the db option?  If you used version 3.0, have you tried to go back to the form and update it?

       
    • Jay

      Jay - 2009-02-11

      I am not using version 3.0. I am using the 2.09c one that came with Fantastico in cPanel.

      tntevert1 says, "The file must already exist as you are appending (fopen("admin/data.dat","a");) to the file. The file must also have a header using the same syntax. The header has the field descriptions being stored in the db." 

      Well tntevert1, I already have a data.dat in the admin folder. I believe the form automatically generates one for each form whether you choose to use the database or not. Either way, I opened the data.dat file and found some entries already in there from a previous form that uses the file-based database. I realized it has all the titles in there for that particular form, so I am thinking if i change them to the titles of my new form, then it will match them and input the data.. could this work?

      To clear this up, I am editing the data.dat file for this new form to have all the titles/header listed there. Let me know if this is totally incorrect =) Thanks

       
      • TNTEverett

        TNTEverett - 2009-02-11

        It does not sound right to me that a new form would get a data.dat file from a previous form.  I have used this version many times and still do use it and have never seen this happen.  In any case the data.dat file can be modified but should have a header (first line) that looks like this:
        fieldname1|fieldname2|fieldname3

        The names and number of names should match those in your form.html file and in the variable used to write to the file:
        $to_put .= $fieldname1value."|".$fieldname2value."|".$fieldname3value.""; 

         
    • Jay

      Jay - 2009-02-11

      Yea I tryed editing and changing the $to_put etc.. and I keep getting different errors. I am just going to redo the form and compare and contrast the changes. Thanks for the help boss man

       

Log in to post a comment.