Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Ghetto Notepad by c|oneman
Thursday, September 9th, 2010 at 12:36:12am MDT 

  1. <html>
  2. <head>
  3. <title> Personal Organizer </title>
  4. </head>
  5. <body bgcolor="#ffffff">
  6. <!-- Ghetto notepad by cloneman -->
  7.  
  8. <form action="notes_adv.php" method="post">
  9. Subject: <input type="text" name="subject" size="30"><br>
  10. <TEXTAREA WRAP=VIRTUAL NAME="content" ROWS=10 COLS=40></TEXTAREA><br>
  11. <input type="submit" value="Add Content">
  12. </form>
  13.  
  14.  
  15. <?php
  16. $file = '001a.ct';
  17. $subject = nl2br(strip_tags($_POST["subject"]));
  18. $content = nl2br(strip_tags($_POST["content"]));
  19.  
  20. $filecontent = file_get_contents($file);
  21.  
  22. if(!empty($subject) or !empty($content)){ // !empty returns false for "",0,"0", whereas isset does not. This line asks "is there content to add?"
  23.  if (!file_exists($file)){touch($file);} // create the file if it doesnt exit
  24. $old = $filecontent; // grab the contents of the file
  25. 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
  26.  
  27. // # get the last post number
  28.  
  29.  
  30. $find_last_post = strpos($filecontent,'@!%',0);
  31.  
  32. if($find_last_post === false) {$linenumber = '0';
  33.  
  34.  }else{
  35.  
  36. $grab_charnum_last_post = strpos($filecontent,'#',$find_last_post);
  37. $lenght_of_number = $grab_charnum_last_post-($find_last_post+3);
  38. $linenumber = substr($filecontent,$find_last_post+3,$lenght_of_number);
  39.  
  40. }
  41.  
  42. $linenumber++; // #add 1 to the last post number, this is the new line
  43. echo '<br>linenumber: '.$linenumber."<br>\n\n";
  44.  
  45. $newstring = '<!-- @!%'.$linenumber.'# --><hr><b><font size="5" color="orange">'.$subject.'</font></b>'.$addbr."$content\n\n".$old; // build the file to be written
  46. file_put_contents("$file",$newstring);
  47.  
  48. } // far up
  49. if($_POST["delete"] == 1)
  50. {$caca =  `mv 001a.ct baka.ct`;
  51. $cacawin =  `del 001a.ct`;}
  52.  
  53.  
  54.  
  55.  
  56. @include($file);
  57. ?>
  58.  
  59.  
  60. <form action="notes_adv.php" method="post">
  61. <input type="hidden" name="delete" value="1">
  62. <input type="submit" value="Delete All Content [!]">
  63. </form>
  64.  
  65. </body>
  66. </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.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



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.

worth-right
fantasy-obligation