dingleberry
Programmer
Hi,
This is such a trivial request I'm a little embarrased to ask it but here goes. I've got a form element which is a multiple select list. It looks something like this...
<form name="resume2" method="post" action="insert_resume2.php">
<select name="interests[]" size="6" multiple>
<option value="Accounting">Accounting</option>
<option value="Admin-Clerical">Admin-Clerical</option>
<option value="Banking">Banking</option>
<option value="Biotech">Biotech</option>
<option value="Broadcast Journalism">Broadcast Journalism</option>
<input type="submit" name="Submit" value="Next >">
and in insert_resume2.php I do a
$interests = $_POST['interests'];
echo $interests[0];
echo $interests[1];
...
but all I get when I execute this is the word "array" and not the individual elements. I need the individual elements but am so new to php I don't know how to get them. I know I can print them with
foreach ($HTTP_POST_VARS["interests"] as $value)
{
print "$value";
}
but I still don't know how to get each individual element so that I can use it to populate a database. I'm very sorry this is so trivial but I'm really getting blue over this one. Any pointers?
Thanks,
Dan
This is such a trivial request I'm a little embarrased to ask it but here goes. I've got a form element which is a multiple select list. It looks something like this...
<form name="resume2" method="post" action="insert_resume2.php">
<select name="interests[]" size="6" multiple>
<option value="Accounting">Accounting</option>
<option value="Admin-Clerical">Admin-Clerical</option>
<option value="Banking">Banking</option>
<option value="Biotech">Biotech</option>
<option value="Broadcast Journalism">Broadcast Journalism</option>
<input type="submit" name="Submit" value="Next >">
and in insert_resume2.php I do a
$interests = $_POST['interests'];
echo $interests[0];
echo $interests[1];
...
but all I get when I execute this is the word "array" and not the individual elements. I need the individual elements but am so new to php I don't know how to get them. I know I can print them with
foreach ($HTTP_POST_VARS["interests"] as $value)
{
print "$value";
}
but I still don't know how to get each individual element so that I can use it to populate a database. I'm very sorry this is so trivial but I'm really getting blue over this one. Any pointers?
Thanks,
Dan