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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..