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> Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.