HTML load TEXT / EASY WEB EDITION

Hi,

I was wondering is there an easier way for ppl who doesn’t know anything about HTML code to edit the text that their websites shows?

so i thought why don’t i make a site which loads TXT files (preformated) so the owner just edits the TXT files according to what they want to express…

I don’t know how many ppl understand what i mean but if u did please give me a hand and show me the WAY.

by the way i don’t want to use iframe… it doesn’t load the style.css

Thats called a CMS or content management system which can use .txt’s if you wanted mysql would be better but .txt’s will work.

on php.net just look up saving files loading files creating files.

… you do know html and basic php right?

I mean you can just do this -> <?php inlcude(‘file.txt’); ?> and just stick that where ever you want the txt to load. I’m not all that great with php so that might be wrong <?php include ‘file.txt’; ?> <?php include “file.txt” ?> i know atleast one of those will work :asian: <- lumpia haha oh, ignor that :cool:

Definately the most efficient and usefull way to impliment this is with php & MySQL, It’s a bit of fun to learn, but once you know it, You will be gratefull for having learned it.

im still trying to get php to like me :hurt:

I mean you can just do this -> <?php inlcude(‘file.txt’); ?>

Will the text formatting be kept in tact? Never tried including a text file before.

^it will read it as script. you can do print(include(‘file.txt’)); i believe. I did something like that i import my .css files instead of linking them in.

It would be best to just get the contents.

Actually NO, tho i actually know HTML ^.^ I am learning from home by forums and www.W3Cschools.com so soon i’ll know PHP and also mySQL.
That’s my goal at least =D… Run a fully working dynamic site using PHP/html/flash, MySQL and CSS… perhaps XML aswell.

Just keep in mind that if you load a text file with php’s include() function you’re not going to have much (if any) formatting. In otherwords it’s fine if you want to include a few lines of text, but you’ll need a bit more to do other things - like say ad breaks in the paragraphs.

If you have a text file (text.txt) like:

Lorem ipsum usu id molestiae pertinacia definitionem, sea esse choro euripidis ex. Sed ne option inciderint, ei meis civibus pri, ius dignissim persequeris et. Magna mundi menandri cu eos. 

Putant meliore persecuti mea ex, harum volutpat eu pri. Mea vitae ornatus accusata ne. Platonem gubergren vim ne, dicam inermis ad per. Vel et illud postea, nemore detracto atomorum ut mea.

and your php was something like:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
  <title>Simple Test</title>
 </head>
 <body>
  <p>

<?php include("text.txt"); ?>

  </p>
 </body>
</html>

You’re not going to have those two paragraphs show up as two separate paragraphs. You’d need to convert the line breaks in the text file to HTML line breaks using php’s nl2br() function. (Or any other method).

That part’s not difficult, but things get more hectic once you start wanting to add a bit more to the text file. Like links for example. So you start off with a simple thing like just using text files as includes, but in the end it turns out to be almost like a template system.

Basically… if you’re new to HTML/PHP/MySQL/etc. and are looking for an easy method you may want to look into a pre-created CMS (http://www.opensourcecms.com/ - there’s a few to look at and try there) and use it. There’s no point in reinventing the wheel. Plus if you grab a pre-created CMS you can start to look at the code behind it to help you learn what’s going on. :slight_smile: