• home
  • forum
  • my
  • kt
  • download
  • Your own personal web based notepad

    Author: 2009-03-08 20:08:49 From:

    Here is a neat thing, How to create your own web based personal notepad, First, Create a new directory on your site named notepad. Inside of it make a new file named index.php, Paste the following code:

                <?php

            if($_POST['save']) {

            $newmsg = stripslashes($_POST['message']);

            $file = fopen("notes.txt","r+");

            ftruncate($file,0);

            $writedate = fwrite($file,$newmsg);

            fclose($file);

            }

            $messages = fopen("notes.txt","r+");

            $message = fread($messages,100000);

            fclose($messages);

            ?>

        

            <form action="<? $php_self ?>" method="post">

            <input type="submit" name="save" value="Save Notes" /><br />

            <textarea name="message" rows="50" cols="100"><?=$message?>

            </textarea>

       <br />

    <input type="submit" name="save" value="Save Notes" />

    </form>

    Now what that does is checks if the submit button has been pressed, If it has then it updates your notes file, and it loads whats in your notes file and displays it in the text area,
    One more step, You need to have a file for storing notes... name a new file named notes.txt leave it blank and save... Upload it to your server and test!
    (PS: CHMOD notes.txt --> 777 so it can be written to.)

    discuss this topic to forum

    relation tutorial

    No information

    Category

      Ad Management (6)
      Calendars (3)
      Chat Systems (8)
      Content Management (41)
      Cookies and Sessions (12)
      Counters (15)
      Database Related (34)
      Date and Time (15)
      Development (22)
      Discussion Boards (8)
      E Commerce (8)
      Email Systems (14)
      Error Handling (8)
      File Manipulation (29)
      Flash and PHP (6)
      Form Processing (19)
      Guestbooks (12)
      Image Manipulation (21)
      Installing PHP (7)
      Introduction to PHP (23)
      Link Indexing (8)
      Mailing List Management (9)
      Miscellaneous (53)
      Networking (8)
      News Publishing (9)
      OOP (24)
      PEAR (6)
      PHP vs Other Languages (2)
      Polls and Voting (6)
      Postcards (1)
      Randomizing (14)
      Redirection (11)
      Searching (9)
      Security (29)
      Site Navigation (16)
      User Authentication (14)
      WAP and WML (7)
      Web Fetching (8)
      Web Traffic Analysis (15)
      XML and PHP (16)

    New

    Hot