jad9321
07-08-2006, 02:36 AM
Ok,
Once more I need help. I have this script
<?PHP
$yourFile = "dbinfo.php";
if(!$_POST['submit']) {
$fs = fopen($yourFile, "r");
while(!feof($fs)) {
$fileData = fread($fs, 1024);
}
}else{
$fs = fopen($yourFile, "w");
fwrite($fs, $_POST['fileData']);
}
fclose($fs);
?>
<form method="POST">
<?PHP print $yourFile; ?>'s contents:
<textarea name="fileData" rows=5 cols=100><?PHP print $fileData; ?></textarea><br />
<input type="submit" value="Save" name="submit">
</form>
And when I change the php file from within there after I save it puts odd /'s in the php file at random places... :/
Once more I need help. I have this script
<?PHP
$yourFile = "dbinfo.php";
if(!$_POST['submit']) {
$fs = fopen($yourFile, "r");
while(!feof($fs)) {
$fileData = fread($fs, 1024);
}
}else{
$fs = fopen($yourFile, "w");
fwrite($fs, $_POST['fileData']);
}
fclose($fs);
?>
<form method="POST">
<?PHP print $yourFile; ?>'s contents:
<textarea name="fileData" rows=5 cols=100><?PHP print $fileData; ?></textarea><br />
<input type="submit" value="Save" name="submit">
</form>
And when I change the php file from within there after I save it puts odd /'s in the php file at random places... :/