Jump to content

Recommended Posts

Posted

In this guide i'll teach you how to make news system for your website only with text files.

 

As for beginning create a text document called - save.txt and leave it empty.

 

Okay open new text document.

Copy this and put it inside.

 

<html><head></head></body><form name="save" method="post" action="save.php">
<textarea name="Text Area">
<? include "save.txt"; ?>
</textarea> <BR>
<input type=submit value="Save">
</form>
</body</html>

Save the file as fsave.php

 

Open a new text document and write this:

<?
$newr = fopen("save.txt","w+");
fwrite($newr, $_REQUEST["Text Area"]);
?>

Save it as save.php

 

The next code is:

 

<?php

$filename = './save.txt';

$fp = fopen($filename, "r");

$string = fread($fp,filesize($filename));

fclose($fp);

echo $string;

?>

Save it as news.php

 

How to put them inside our index page or any other page?

Here is the code:

 

<p>
<object id="News" type="text/html" data="news.php" width="400" height="100"></object>
</p>

 

Ofcourse you can make yourself a template and include them inside it.I hope i've helped Enjoy!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...