PHP "Text Import"

Knights

You can change this now in User CP.
Reaction score
71
I know there is a way to do this, just can't recall the PHP syntax to use. I want to make it so in my www folder I have a file called, say, news.txt or news.php, and my index.php will take all the text inside that file, and I can pull it up like a variable. That way over several pages I can simply edit one file and it will change them all.

Thanks,
Knights:cool:
 

enouwee

Non ex transverso sed deorsum
Reaction score
240

And don't use the two first ones unless necessary. If you only need to print the content of the file without interpreting any variables it contains, limit yourself to file_get_contents() and friends.

You don't want bad things (TM) to happen, like remote file inclusion, which leads to a defacement and compromise to the server. Make sure you triple-check your input on include($var) or require_once($var).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top