PHP script to work but it will not read the array’s for the checkbox…?

hotgirlvick

New member
Ok I am stuck again…

I created the script to collect the data the way I want it too and it worked…

$filename = "C:\some.txt";
$data = "$Fname | $Lname | $gender | $interest | $email | $comments\n";
$fh = fopen($filename, 'a+') or die("can't open file");
fwrite($fh, $data);
fclose($fh);

I have added all the records to the txt file… but the array for $interest is only picking up the last option from the check box. Can anyone help me with this… because maybe I do not have the script reading the data right.

Also can you point me in the right directions to get this data to display as a table…

If someone could send me a link to a PHP website that would help me learn and “understand” that would help me more than you know… I have goggled till I can’t Google anymore.

I really want to learn PHP… to grow in my career.
This is the part of the code I completed and I am adding it to the script...

************************************************************
My code:

$filename = "C:\some.txt";
$data = "$Fname | $Lname | $gender | $interest | $email | $comments\n";
$fh = fopen($filename, 'a+') or die("can't open file");
fwrite($fh, $data);
fclose($fh);

***********************************************************

The array for $interest is only picking up the last check box from the form...

I also need to create another script so it will display the data on a table like an excel doc.

Sorry for the confusion
 
Without seeing all your code, it's difficult to answer.

Try this:

$data = "$Fname | $Lname | $gender | " . implode(",". $interest) . " | $email | $comments\n";
 
Without seeing all your code, it's difficult to answer.

Try this:

$data = "$Fname | $Lname | $gender | " . implode(",". $interest) . " | $email | $comments\n";
 
Back
Top