Jump to content

rambothefirst

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by rambothefirst

  1. PHP can read and write files. One way is to use file_get_contents to read a file, and file_put_contents to write to a file.

     

    Is there a better way to open the file and display the text other then the way I am opening text from the code in my first post.?

  2. This line is a problem because you're already inside a <?php ?> block:

    $f = $_SERVER['DOCUMENT_ROOT'] . "/files/<?php echo safeOutputToScreen($file->localFilePath, null, 55); ?>";

    Substitute it with

    $f = $_SERVER['DOCUMENT_ROOT'] . "/files/" . safeOutputToScreen($file->localFilePath, null, 55);

    It might not be the only problem, but it's best to start with the most obvious thing to fix.

     

    Thanks Foxy Mod I have it working now.

     

    Is it possible with PHP to open the text file and edit it in textbox and auto save in the same text file.?

  3.  

    1. <script>document.getElementById('editor1').defaultValue="<?php echo $string ?>";</script>

    echo is missing ;

    <?php echo $string; ?>

     

    Sorry my fault it don't work with ; it is just not there because I was copy & pasting. I have tried echo in many different ways. I can also get it to output in the textbox, /files/<?php echo safeOutputToScreen($file->localFilePath, null, 55); ?> it just don’t seem to notice the php and place it as a string.

  4. Hello all,

     

    Really need help with this I have been working on it for a few days, but no luck getting it to work. I am trying to get the file from the server location and place it into a text-box with an editor installed. My first php $file shows the location I need if I echo it, but when I place it all together and try to use js to echo $string its not displaying the text from the file.

    <?php$f = $_SERVER['DOCUMENT_ROOT'] . "/files/<?php echo safeOutputToScreen($file->localFilePath, null, 55); ?>";$contents = file($f);$string = implode($contents);echo $string;?> <form><textarea  id="editor1" name="editor1"></textarea></form><script>CKEDITOR.replace( 'editor1' );</script><script>document.getElementById('editor1').defaultValue="<?php echo $string ?>";</script></div></div></div></body><? include('_footer.php'); ?><?php end() ?> 
×
×
  • Create New...