Online Simple Notepad Source Code

First One:

 * # myVirtualNotepad 1.0, by Christian Dechery

 // Edit the line below to set the timezone in which this app is running

 $action = $_POST["action"];
 $contents = $_POST["contents"];

 if( $_GET["action"] == "dummy" ) {

 if( $action == "update" ) {
 $arq = fopen("./notepad.txt", "w") or die("<div align=center><font face=Tahoma size=2 color=red>Error on updating notepad.txt, check file permissions.<h1>");
 if( strlen($contents)==0 ) {
 fwrite($arq, null, 0);
 } else {
 fwrite($arq, trim($contents) ) or die("<div align=center><font face=Tahoma size=2 color=red>Error on updating notepad.txt, check file permissions.<h1>");

 die("<div align=center><font face=Tahoma size=2>Last saved @ ".date("H:i:s")."</font>");

 $arq = fopen("notepad.txt", "r");

 // file not found, attempt to create one.
 if( $arq == FALSE ) {
 $arq = fopen("./notepad.txt", "w") or die("<font size=2 color=red face=Tahoma>Could not create notepad.txt file. Check folder/PHP permissions");
 $contents = "### Automatically generated file/contents. You're good to go. Enjoy! =) ###";
 fwrite($arq, $contents);
 } else {
 $contents = "";

 while( !feof($arq) ) {
 $contents .= fgets($arq, 4096);

 <title>:: myVirtualNotepad :: </title>
<script language="Javascript">

 window.onbeforeunload  = onBeforeUnloadAction;

 function onBeforeUnloadAction() {
 return checkSaved();

 var saved = true;
 var savedContent = '';

 function doUpdate(e) {
 var keynum;
 var keychar;

 if(window.event) { // IE
 keynum = e.keyCode;
 } else if(e.which) { // Netscape/Firefox/Opera
 keynum = e.which;

 if( keynum == 13 && e.ctrlKey ) { // Ctrl+Enter
 if( notepadFrm.contents.value.length == 0 ) {
 if( confirm('Are you sure you want to erase all the notepad contents?') ) {
 saved = true;
 savedContent = notepadFrm.contents.value;
 } else {
 saved = true;
 savedContent = notepadFrm.contents.value;

 function titleSaved() {
 document.title = ':: myVirtualNotepad ::';

 function titleUnsaved() {
 document.title = ':: myVirtualNotepad* ::';

 function doChange() {
 if( notepadFrm.contents.value != savedContent ) {
 saved = false;

 return false;

 function checkSaved() {
 if( !saved ) {
 return 'WARNING! There is unsaved content in the Notepad.';
 } else {
 return null;
 <body bgcolor="#C0C0C0">
 <form method="post" name="notepadFrm" target="update">
 <input type="hidden" name="action" value="update">
 <p align="center"><font face="Tahoma" size=6>m y V i r t u a l N o t e p a d</font></p>
 <p align="center">
 <textarea rows="25" cols="100" onChange="return doChange()" onKeyDown="doUpdate(event)" name="contents" style="font-family: Verdana; padding: 5px; background-color: LightYellow">
<?php echo $contents ?></textarea><br>
 <font face="tahoma" size="2">Press Ctrl+Enter (inside the text field) to save</font>

 <div align="center">
 <iframe name="update" src="index.php?action=dummy" marginheight="0" marginwidth="0" height="20" width="400" frameborder="0">
 <p>Your browser does not support iframes. myVirtualNotepad won't work. =(</p>

The Second one: Continue reading

Albert Einstein Quotes Collection

Following Quotes Are Collected From Various Websites

“Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.”

“Imagination is more important than knowledge.”

“Gravitation is not responsible for people falling in love.”

“I want to know God’s thoughts; the rest are details.”

“The hardest thing in the world to understand is the income tax.”

“Reality is merely an illusion, albeit a very persistent one.”

“The only real valuable thing is intuition.”

“A person starts to live when he can live outside himself.”

“I am convinced that He (God) does not play dice.”

“God is subtle but he is not malicious.”

“Weakness of attitude becomes weakness of character.”

“I never think of the future. It comes soon enough.”

“The eternal mystery of the world is its comprehensibility.”

“Sometimes one pays most for the things one gets for nothing.”

“Science without religion is lame. Religion without science is blind.”

“Anyone who has never made a mistake has never tried anything new.”

“Great spirits have often encountered violent opposition from weak minds.”

“Everything should be made as simple as possible, but not simpler.”

“Common sense is the collection of prejudices acquired by age eighteen.”

“Science is a wonderful thing if one does not have to earn one’s living at it.”

“The secret to creativity is knowing how to hide your sources.”

“The only thing that interferes with my learning is my education.”

“God does not care about our mathematical difficulties. He integrates empirically.”

“The whole of science is nothing more than a refinement of everyday thinking.”

“Technological progress is like an axe in the hands of a pathological criminal.”

“Peace cannot be kept by force. It can only be achieved by understanding.”

“The most incomprehensible thing about the world is that it is comprehensible.”

Continue reading