CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Dynamic Style Listbox [PHP]

Print topic Send  topic

Author Message
feha


Posts: 712
Posted: 04/17/2006, 1:48 AM

Here is a function i created to read Styles dir and make a listbox of found Styles ...

  
//============================================================================  
function VISION_TO_STYLES_BOX ($dirName = "../Styles", $select_text = "Styles") {  
global $option;  
$d = dir($dirName);   
while($entry = $d->read())   
{  
if ($entry != "." && $entry != "..")   
{  
if (is_dir($dirName."/".$entry) )  
{  
if(CCGetSession(style) == $entry )  
{  
$option .="<option selected=\"selected\" value=\"$entry\">$entry</option>\n";  
}  
else  
{  
$option .="<option value=\"$entry\">$entry</option>\n";  
}  
}  
}   
}  
$d->close();  
return "<select class=\"VisionToSelect\" name=\"style\" size=\"1\" >\n<option value=\"\"> $select_text </option>\n".$option."</select>\n";   
}  
	//echo VISION_TO_STYLES_BOX();exit;  
//============================================================================  
Note: You need to create your own form tags or use it within any form ...
you can put the function call into label (HTML) wherever you want to display styles ...
When you add new Style it will be listed in Styles Box ...

Enjoy
feha

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.