so I’m trying to make it so that I can open a file, and display it in a textarea. I want to then be able to edit it and save it. I have done this and the file is created successfully. The only weird thing is, no matter what file I use, it always deletes code from the top of the page.
When it displays my “index-generic.php” file in the text area it should be
[code=php]
<?php
require(“header.php”); //Edit this
if (isset($_SESSION[‘id’]))
{
print ‘<title> || ‘.$_SESSION[‘un’].'</title>’; //Edit this
print ‘<div align=center>’;
$d = opendir(‘.’) or die($php_errormsg);
$jpg = explode(“.jpg”,$f);
but instead it comes out as
[code=php]
<title> || ‘.$_SESSION[‘un’].'</title>’; //Edit this
print ‘<div align=center>’;
$d = opendir(‘.’) or die($php_errormsg);
$jpg = explode(“.jpg”,$f);
the code that is reading the file is as follows:
[code=php]
$fileName = ‘blank_things/index-generic.txt’;
$fileHandle = fopen($fileName,’r+’) or die(“Can’t Open File”);
$data = fread($fileHandle,filesize($fileName));
It’s weird, to me, because it’s just not printing the entire file in the text area, but I can go to the file ( I made it a .txt so nothing would execute) and it was all there. At first I was confused because the filesize was different than on my computer, but I asked a friend (a network admin) and he says that that can happen, depending on settings. So….I dont know how to fix it..I think thats enough, if not I’ll post more (I just didn’t want to clog up the post with the entire script becuase the rest doesn’t matter)…I think…
anyways, thanks in advance for the help,
~EMH