2 PHP Scripts… will not work correctly…?

hotgirlvick

New member
Part One:

I have created a form in which there is check boxes for (user interest) there are five options the user can check as many check boxes they like.

echo "Thank you for completing the survey we have noted that you have the following intrest:</br></br>";
foreach ($intrest as $i) {
echo "<li> $i </li></br></br>";
}

Works perfectly

My problem… is writing each selected interest to a file… Once I submit the form with the following code if I check three of the intrest only the last one shows up in my file…

Here is my code…

$filename = "C:\test.txt";
$data = ("$name, $gender, foreach ($intrest as $i), $emails\r\n");
$newfile = fopen($filename, 'a+') or die("can't open file");
fwrite($newfile, $data);
fclose($newfile);


Part Two:

I need to create a script to read the data from the txt file and display the data in table…

I got this to work as well but the tables are everywhere…

Can anyone help… or point me in the right direction because I am not getting it…
 
Back
Top