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:16

Language PHP

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

Download Here

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