Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.