1 Replies - 795 Views - Last Post: 24 January 2013 - 07:45 PM Rate Topic: -----

#1 stefanere2k9  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 15-November 11

saving selected array value to a variable

Posted 22 January 2013 - 11:22 AM

i have created an array to save the selected files in my folder and display these value in a dropdown box but i want to save the selected file which i can call later to view in a table. here the code i got so far to put the file into a dropdown box

$dir = opendir("C:/xampp/htdocs/xml");

//List files in images directory
while (($file = readdir($dir)) !== false)
  {
	  $last4 = substr($file, -4); 
	  if ($last4 == ".xml")
	  {
		 $files[] = $file;
		  
	  }
  }
closedir($dir);


printf ('<select>');

foreach($files as $let => $val){
	printf ('<option value="'.$let.'">'.$val.'</option>');
	
}
printf ('</select>');

?>


Is This A Good Question/Topic? 0
  • +

Replies To: saving selected array value to a variable

#2 ZevhEr  Icon User is offline

  • New D.I.C Head

Reputation: 9
  • View blog
  • Posts: 38
  • Joined: 18-July 09

Re: saving selected array value to a variable

Posted 24 January 2013 - 07:45 PM

try using session.
Session
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1