Welcome Anonymous

What would you like to do?


Paste code remember you name for one cookie

Pasted by Code

Description None

On Monday 20 Mar 23:17

Language PHP

Url http://paste.ideaslabs.com/show/hwj7IiPUcd

Download Here

  1.  
  2. <body>
  3.  <div class="form">
  4.  
  5.    <form method="POST">
  6.    <p>Please enter</p>
  7.         <p>Amount</p>
  8.    <input type="number" name="amount" /><br />
  9.         <p>Category</p>
  10.    <input type="text" name="category" /><br />
  11.    <p>Account</p>
  12.         <input type="text" name="account" /><br />
  13.         <p>Note</p>
  14.         <input type="text" name="note" /><br />
  15.    <input type="submit" value="Submit">
  16.  
  17.  
  18.  <?php
  19.  
  20. $dates = date('d');
  21. $month = date('m');
  22. $year = date('Y');
  23.  
  24. $amountp = $_POST['amount'];
  25. $categoryp = $_POST['category'];
  26. $accountp = $_POST['account'];
  27. $notep = $_POST['note'];
  28.  
  29. $arrayp = array($amountp,$categoryp,$accountp,$notep);
  30.  
  31.  
  32. if (isset($amountp)&&!empty($amountp)){
  33.  
  34.         $final = "\nDate:" . $dates . "\nMonth:" . $month . "\nYear:" . $year . "\nAmount:" . $amountp . "\nCategory:" . $categoryp . "\nAccount:" . $accountp . "\nNote:" . $notep . "\n";
  35.  
  36.         file_put_contents('data.txt', $final, FILE_APPEND);
  37.  
  38. }
  39.  
  40. // Retrieve data from file and process
  41.  
  42. $arraynext = file_get_contents('data.txt');
  43.  
  44. $endresult = preg_split("/Amount:/", $arraynext);
  45.  
  46.  
  47. foreach ($endresult as $printresult) {
  48.  
  49.         $truncated = substr($printresult, 1, 2);
  50.  
  51.         print_r($truncated);
  52.  
  53. }
  54.  
  55.  ?>
  56.  
  57.  
  58.  
  59. </body>
  60.  
  61. </html>