Newbie - PHP/HTML POST SESSION Array help needed.
Posted: Thu May 04, 2006 8:17 am
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Can somebody please help? I am trying to get an Array passed using session variable. As the following code shows, the results of an sql query are displayed from an array. This part works fine. Now I want to store what the user selects from this list in a session array and pass it on to the next page
All I get in the session array is the word Array. Please help.Code: Select all
<?php
session_start();
echo "<select multiple=multiple name=assessment_value[] size=5>";
$assesslist=array();
$assesslist=get_assessment_list_by_org($conn,$org_ index);
$i=0;
while ($i!=count($assesslist))
{
printf("<option value=\"%s\">%s\t%s",$assesslist[$i][0],$assesslist[$i][2],$assesslist[$i][1]);
$i++;
}
echo"</select>";
if(count($_POST['assessment_value'] > 0)){
$assess_index_gen = implode(",",$_POST['assessment_value']);
}
else {
echo "nothing in assessment value";
}
$_SESSION['gbl_assess_index'] = $assess_index_gen;
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]