Hi everyone! I'm pretty new at php (though not at programming; I know some Java, so all is good), so please help me out here!
I currently have a website for some writers. These writers would write stories/poems/etc and send them to me, and then I would create new html files and edit links on the site where necessary to "post" that story. Go here to see what I'm talking about.
The problem is, it takes me forever to add one of their stories because I have to first make and then edit their writing into html, and then edit links and stuff and it's just annoying.
So, I'm trying to make a php script. The problem is, everywhere i go on the web, tutorials talk about truncating a file, appending to a file, reading a file... but never "editing" a file. I know that since php is a such a powerful language, there must be a way to do this!
What I want is, say I have some code like:
Code:
<html>
<head></head>
<body>
<p>This is my first paragraph.</p>
<p>This is my second paragraph</p>
</body>
</html>
I want to be able to, using php, change the code to... say:
Code:
<html>
<head></head>
<body>
<p>This is my first paragraph. foo!</p>
<p>This is my second paragraph. bar!</p>
<p>This 3rd paragraph was added automagically by php.</p>
</body>
</html>
How would I accomplish this? many thanks!
__________________
Please login or register to view this content. Registration is FREE - The most comprehensive online resource for students and educators.
|