Jump to content

Including HTML links in form drop-lists


howard-moore

Recommended Posts

Hi Everyone,

 

I am nearly there with a script but have hit something of a stumbling block.

 

I have the following bit of code which when called brings up a list of links to directories located elsewhere on the server. The idea is to create a system of automatically adding links to a textarea to a dynamically created list of directories for people who are not very good at html coding:

 

<?php
// If there are directory
if(!empty($jmnp_directories)) {
	foreach($jmnp_directories as $key => $value) {
		$directory_name = $value['name'];
		$directory_size = format_size($value['size']);
		$directory_date = date('jS F Y', $value['date']);
		echo "<option value=\"".url($directories_before_current_path.$current_directory_path.$directory_name,'dir')."&by=date&order=asc\">$directory_name</option>\n";
	}
}
?>

 

What I need help with now is a way to include more than just the parth to the directory in the OPTION VALUE. I need to include

<a href="[i]PATH TO DIRECTORY[/i]">$directory_name</a>

in the OPTION VALUE, but I cannot work out how this is done.

 

Any help really gratefully received!

 

Neil

Link to comment
https://forums.phpfreaks.com/topic/184257-including-html-links-in-form-drop-lists/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.