Results 1 to 3 of 3

Thread: Editing Pages Using PHP

  1. #1

    Thread Starter
    Hyperactive Member flame_211's Avatar
    Join Date
    Jun 2000
    Location
    I dont really think I know where I am???
    Posts
    393

    Editing Pages Using PHP

    Argh.... Everytime I try to save a page using this PHP codeing:
    PHP Code:
    <?php
    if( isset( $_POST["code"] ) ){
     
    $f fopen"ftp://me:[email protected]/index.php""w" );
     
    fwrite$f$_POST["code"] );
    }
    ?>
    <form action="<?=$_SERVER["PHP_SELF"]?>" method="post">
    <textarea name="code" rows=20 cols=80><?php readfile"index.php" ); ?></textarea><br />
    <input type="submit" value="Save it, baby!">
    </form>
    I get this error message:
    Warning: fopen("ftp://[email protected]/index.php", "w") - Success in /home/alltom/public_html/flame/editpg.php on line 3
    Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/alltom/public_html/flame/editpg.php on line 4

    I originally had fputs, but it didnt work either... :'( please help me...
    Reach me at:
    AIM: FlameWide
    AIM: Itz deep6
    MSN/Email: [email protected]

    Check out these sites:
    My Blog

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    try this
    PHP Code:
    <?php
    if( isset( $_POST["code"] ) ){
    $data $_POST["code"];
     
    $f fopen"ftp://me:[email protected]/index.php""a+" );
     
    fwrite$f$data );
    }
    ?>
    <form action="<?=$_SERVER["PHP_SELF"]?>" method="post">
    <textarea name="code" rows=20 cols=80><?php readfile"index.php" ); ?></textarea><br />
    <input type="submit" value="Save it, baby!">
    </form>

  3. #3

    Thread Starter
    Hyperactive Member flame_211's Avatar
    Join Date
    Jun 2000
    Location
    I dont really think I know where I am???
    Posts
    393
    thanks, ill try it
    Reach me at:
    AIM: FlameWide
    AIM: Itz deep6
    MSN/Email: [email protected]

    Check out these sites:
    My Blog

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