- Ghetto Notepad by c|oneman
- Thursday, September 9th, 2010 at 12:36:12am MDT
- <html>
- <head>
- <title> Personal Organizer </title>
- </head>
- <body bgcolor="#ffffff">
- <!-- Ghetto notepad by cloneman -->
- <form action="notes_adv.php" method="post">
- Subject: <input type="text" name="subject" size="30"><br>
- <TEXTAREA WRAP=VIRTUAL NAME="content" ROWS=10 COLS=40></TEXTAREA><br>
- <input type="submit" value="Add Content">
- </form>
- <?php
- $file = '001a.ct';
- $subject = nl2br(strip_tags($_POST["subject"]));
- $content = nl2br(strip_tags($_POST["content"]));
- $filecontent = file_get_contents($file);
- if(!empty($subject) or !empty($content)){ // !empty returns false for "",0,"0", whereas isset does not. This line asks "is there content to add?"
- if (!file_exists($file)){touch($file);} // create the file if it doesnt exit
- $old = $filecontent; // grab the contents of the file
- if(!empty($subject) and !empty($content)){$addbr = '<br>';} // sets itself up to add a a space b/w subject and content if there is a subject AND content
- // # get the last post number
- $find_last_post = strpos($filecontent,'@!%',0);
- if($find_last_post === false) {$linenumber = '0';
- }else{
- $grab_charnum_last_post = strpos($filecontent,'#',$find_last_post);
- $lenght_of_number = $grab_charnum_last_post-($find_last_post+3);
- $linenumber = substr($filecontent,$find_last_post+3,$lenght_of_number);
- }
- $linenumber++; // #add 1 to the last post number, this is the new line
- echo '<br>linenumber: '.$linenumber."<br>\n\n";
- $newstring = '<!-- @!%'.$linenumber.'# --><hr><b><font size="5" color="orange">'.$subject.'</font></b>'.$addbr."$content\n\n".$old; // build the file to be written
- file_put_contents("$file",$newstring);
- } // far up
- if($_POST["delete"] == 1)
- {$caca = `mv 001a.ct baka.ct`;
- $cacawin = `del 001a.ct`;}
- @include($file);
- ?>
- <form action="notes_adv.php" method="post">
- <input type="hidden" name="delete" value="1">
- <input type="submit" value="Delete All Content [!]">
- </form>
- </body>
- </html>
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.