Hey guys, been searching for a answer on my question for ~20minutes, Im not experienced with php that much and Im stuck.
what I trying to do is display a serie of rss feeds, through simplepie (rss parser), basicly its library requests a list of feed written in a array.
What Im trying to add is a POST option with some checkboxes where the users can filter amongst the feeds.
What I got is this:
if (isset($_POST['submit'])) {
$choice = $_POST["choice"];
$feed->set_feed_url($choice[]);
}
else {
$feed->set_feed_url(array(
'http://feed1',
'http://feed2/',
'http://feed3/',
'http://feed4',
));
}
And the form looks like this:
<form method="post">
<input type="checkbox" name="choice[]" checked="checked" value="http://feed1">feed1 <br>
<input type="checkbox" name="choice[]" checked="checked" value="http://feed2">feed2 <br>
<input type="checkbox" name="choice[]" checked="checked" value="http://feed3">feed3 <br>
<input type="checkbox" name="choice[]" checked="checked" value="http://feed4">feed4 <br>
<input type="submit" name="submit" value="Update">
So my newbish question is how do I get choice[] to display like the array in the else {}.
Cheers
(Oh and yes as long as I dont press the submit button the page works.)