Hello:
I'm using fputs and script below to export information entered by in an online form. After each variable (for example: your name, your email, your message) I've placed a / sign. The information is saved in a text file.
As I open the text file in excel and defining the / as a divider/Delimiters the end results is that I am getting one line and each column has different data field.
YET, the problem is if a user in a text box for example like 'your message' is using the enter key, then we don't get a new line and it is hard to analyze the data and see which one is from which new user.
Is there a way that even users use the enter key I still get one line in excel?
How can I export this information in an elegant way to an excel sheet?
(Tried this dude - http://www.phpfreaks.com/tutorials/114/0.php didn’t get it)
Help!
Thank you. Grace.
<?php
$datesresult = '8ChoicesDatingResults.txt';
$fp = fopen( $datesresult, "a");
$fromname = $_POST['fromname'];
$fromemail= $_POST['fromemail'];
$friendsemail = $_POST['friendsemail'];
$message = $_POST['message'];
$SpreadTheLove = 'SpresdTheLove';
$end = "End";
$space = "/";
fputs($fp, $space);
fputs($fp, $SpreadTheLove);
fputs($fp, $space);
fputs($fp, $fromname);
fputs($fp, $space);
fputs($fp,$fromemail);
fputs($fp, $space);
fputs($fp, $friendsemail);
fputs($fp, $space);
fputs($fp, $message);
fputs($fp, $space);
fputs($fp, $end);
fclose($fp);
?>
|