Advertisement
Guest User

Untitled

a guest
Nov 20th, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <pre>
  2. <?php
  3. // get form results
  4. $email = $_GET['email'];
  5.  
  6. //
  7.  
  8. $file_path = "form-output/new_interest_list.csv";
  9. require_once('parsecsv-0.3.2/parsecsv.lib.php');
  10. $csv = new parseCSV($file_path);
  11. //$csv->auto('data.csv');
  12. $csv_array = $csv->data;
  13.  
  14. print_r($csv_array);
  15. // check if email already in csv
  16.  
  17. for($row=0; $row <= count($csv_array); $row++) {
  18. print "\n=PARSING ROW $row OF \$csv_array=\n\n";
  19. print "\$row is $row\n";
  20. print_r($csv_array[$row]);
  21. print "\n==FOREACH==\n";
  22. foreach ($csv_array[$row] as $key => $value) {
  23. print "$key\n$value\n\n";
  24. }
  25.  
  26. print "\n=KEYS FOR ROW $row=\n\n";
  27. print_r(array_keys($csv_array[$row]));
  28.  
  29. PRINT "\n==PRINT==\n";
  30. print '$csv_array[$row][\'email\'] is '.$csv_array[$row]['email']."\n\n";
  31. if ($csv_array[$row]['email'] == 'DUMMYEMAIL') {
  32. print_r($csv_array[$row]);
  33. } else {
  34. print "DUMMYEMAIL not found\n";
  35. print($csv_array[$row]['email'] );
  36. }
  37. }
  38.  
  39. //fwrite($fh,"'$name','$email','$Volunteering','$Blog','$News','$chapter_interested_in','$how_you_heard','$how_you_heard_other'\n");
  40. //fclose($fh);
  41.  
  42.  
  43. //redirect - PENDING STEPH
  44. //header( 'Location: http://www.givingwhatwecan.org/' );
  45. ?>
  46. </pre>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement