processing multicheckboxes into csv file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
slamka
Forum Newbie
Posts: 1
Joined: Thu Jan 12, 2012 5:19 pm

processing multicheckboxes into csv file

Post by slamka »

Hi,
I am total beginner in php, all my knowledge i glued from interne sources, so i realy dont have any theoretical background, no training, nothing..

i have maybe very simple problem for you. I have created a form with multiple checkboxes. it is showed here:

<form name="cezform" action="export.php" method="POST" onsubmit="return formvalidation(this)">
<b>Something </b><br>
<input type="checkbox" name="anything[]" value="pozvanky" checked> Pozvánky<br>
<input type="checkbox" name="anything[]" value="program" checked > Program <br>
<input type="checkbox" name="anything[]" value="etikety" checked> Etikety na víno
</form>

i use export.php for processing and also i want it to be exported in .csv file. so in my export I have this so far:

$tlacoviny = $_POST['tlacoviny']; I think this may look differently, because it doesnt call all the names...I really dont know..

this is how it is coded to be exported to .csv

$csv= <<<EOD
<html>
<head>
</head>
<body>
<tr>
<td>
Something
</td>
<td>
$anything
</td>
</tr>
</table>
</body>
</html>
EOD;


thanks a lot for your help..
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: processing multicheckboxes into csv file

Post by Christopher »

Given your form, it shoul be:

Code: Select all

$anything = $_POST['anything'];
print_r($anything);
Why does your CSV file have HTML in it?
(#10850)
Post Reply