Jump to content

Edit file from Browser.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
xsell

xsell

    Newbie

  • Members
  • Pip
  • 4 posts
Hello

I'm no coder ,

How do you edit a txt file from browser and save it ..

Please if any can give me a example
thx

#2
SeanStar

SeanStar

    Learning Programmer

  • Members
  • PipPipPip
  • 32 posts
Are you talking about with php? You could always use the fopen feature...
Eg:
<?php


$handle = 


fopen("Text.txt", "a");

fwrite($handle, "Text");

fclose($handle);

?>

Edit: Also you must set permissions on that file for the script to add the text..

#3
xsell

xsell

    Newbie

  • Members
  • Pip
  • 4 posts
I totly forget about this Post . Thank you Seanstar .

I have already Found way to do it .. thx anyway

#4
sastro

sastro

    Newbie

  • Members
  • PipPip
  • 12 posts
fopen fopen("Text.txt", "a"); is not to edit the text.txt file but append the text in the file. To replace with new edited text, you shold use fopen("Text.txt", "w+");