Jump to content


Can anyone see why this is not outputing any dynamic html

  • Please log in to reply
1 reply to this topic

#1 madspof

  • Members
  • PipPipPip
  • Advanced Member
  • 271 posts

Posted 23 October 2006 - 08:35 AM

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...ml4/loose.dtd">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

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>";

#2 gmwebs

  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 23 October 2006 - 08:58 AM

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 - www.php.net

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users