Paragraph Pains

I have 2 sets of php scripts.

The first stores information from a form into a csv file
[php]

<?php $mm = $_POST['mm']; $dd = $_POST['dd']; $yy = $_POST['yy']; $name = $_POST['name']; $comment = $_POST['comment']; $lines = file('datafeed/filetoread.csv'); $fp = fopen("datafeed/filetoread.csv", "w+"); $header = array_shift($lines); $savestring = $header . $mm . " " . $dd . " " . $yy . " " . $name . " " . $comment . "\r\n"; fwrite($fp, stripslashes($savestring)); foreach($lines as $line) fwrite($fp, "$line"); fclose($fp); echo "

Your data has been saved

"; ?>

[/php]

The second reads the csv file and displays the content on a webpage.

Somewhere in here I need support for papragraphs for one of my form feids that collects users comments in which the user will sometime use multiple paragraphs.

Thank you in advance and any help is much appreciated

sorry but what is to be displayed in paragraphs??

Sorry, I forgot to add the part of the script that reads the csv. The comments field is the one that has to support paragraphs.

[php]

<?php //create table with header and column names print(''); print(''); //declare variable to count records $rowcount = 0; //get path to file assuming that file located in datafeed folder $path_to_file="datafeed/filetoread.csv"; //open file for reading "r" $handle = fopen($path_to_file, "r"); //read file line by line. Enter tab between quotation marks while (($record = fgetcsv($handle, 1000, " ")) !== FALSE) { // read number of fields in one record $numrecords = count($record); //read field values in variable $mm=$record[0]; $dd=$record[1]; $yy=$record[2]; $name=$record[3]; $comment=$record[4]; //skip the first record since it has field headers only if($rowcount > 0) { //if record has link to item display it in the table row if($record[3] !="") { print(' '); } } $rowcount++; } fclose($handle); print('

Testimonials

'.$mm.'/'.$dd.'/'.$yy.'
'.$comment.'
'.$name.'
'); ?>

[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service