madspof Posted October 23, 2006 Share Posted October 23, 2006 Hi i have this bit of php and it is supposed to output a dynamic menu but it does not output anythink can anyone see were i am gonig wrong here is the script:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><?php function generate_menu($MENU, $options, $default="") {$html = "<SELECT NAME=\"$name\">";foreach($options as $value => $label){ $html .= "<OPTION "; if ($value == $default) $html .= "SELECTED "; $html .= "VALUE=\"$value\">$label</OPTION>";}$html .= "</SELECT>";return($html);}?></p></body></html> Link to comment https://forums.phpfreaks.com/topic/24814-can-anyone-see-why-this-is-not-outputing-any-dynamic-html/ Share on other sites More sharing options...
gmwebs Posted October 23, 2006 Share Posted October 23, 2006 You have just placed a php function in the body of the html. It will not return anything unless you call it. I suggest you read up about PHP funtions and what they do.PHP Documentation - [url=http://www.php.net]www.php.net[/url] Link to comment https://forums.phpfreaks.com/topic/24814-can-anyone-see-why-this-is-not-outputing-any-dynamic-html/#findComment-113022 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.