|
-
Dec 6th, 2002, 10:41 PM
#1
Thread Starter
Hyperactive Member
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...
-
Dec 10th, 2002, 03:11 PM
#2
Frenzied Member
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>
-
Dec 10th, 2002, 06:56 PM
#3
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|