Results 1 to 4 of 4

Thread: backup code flat file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    Michigan
    Posts
    143

    Arrow backup code flat file

    I need the small bit of code to backup some data. I have like 10 text areas that I want backed up to a flat file based on date.


    So basically I will have a button in my script that will say "backup data"

    and all my textarea's will be backed up according to todays date, when the button is pressed.

    for example, 07_13_04-backup


    Any idea on how to do this?

  2. #2
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Well, #1, you have realize that the backups will only be on the server. PHP can only write to the server's HD.

    #2, check this out. You will obviously set your text area page up to be a form and on a submit, you process it using fwrite.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    Michigan
    Posts
    143
    I know. ITs going to be written to the servers HD.

    Heres a zip file of my script. admin.php is the file that would probably have the backup code in it. Maybe check it out? Easy script to understand.


    Thanks for any code/help u can give!
    Attached Files Attached Files

  4. #4
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    1) Turn off global variables if you are using them.
    2) Everything will be passed in the POST array (which you have chosen) and can be accessed like this:
    PHP Code:
     $POST_['sent1'
    And then we have to talk about this:
    PHP Code:
    $a = fopen("conf.php", "w") or die ("Dosya aÝlamadÝ!");
    fputs($a, "<?php
    \$tablewidth= \"$tablewidth\";
    \$tableheight= \"
    $tableheight\";
    \$bgcolor = \"
    $bgcolor\";
    \$border = \"
    $border\";
    \$scrollspeed = \"
    $scrollspeed\";
    \$fontsize = \"
    $fontsize\";
    \$fontstyle = \"
    $fontstyle\";
    \$fontcolor = \"
    $fontcolor\";
    \$bold = \"
    $bold\";
    \$lineheight = \"
    $lineheight\";
    \$sent1 = \"
    $sent1\";
    \$sent2 = \"
    $sent2\";
    \$sent3 = \"
    $sent3\";
    \$sent4 = \"
    $sent4\";
    \$sent5 = \"
    $sent5\";
    \$sent6 = \"
    $sent6\";
    \$sent7 = \"
    $sent7\";
    \$sent8 = \"
    $sent8\";
    \$sent9 = \"
    $sent9\";
    \$sent10 = \"
    $sent10\";
    \$sent11 = \"
    $sent11\";
    \$sent12 = \"
    $sent12\";
    \$sent13 = \"
    $sent13\";
    \$sent14 = \"
    $sent14\";
    ?>\n"
    );
    fclose($a);
    print (
    "$success");
    ?>
    1) Why do you open/close a php block inside of a php block?
    2) What are those slashes for? (the ones at the beginning of all the lines)

    Are you getting any output?

    edit: I guess you can't color code in a php block.
    Last edited by ober0330; Jul 14th, 2004 at 10:14 AM.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

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



Click Here to Expand Forum to Full Width