First:  I've not seen a print statement in that format before.
Second:  the following line has parameters misspelled twice.  Your function
is called with "parameters", not "paramaters"
  if(isset($paramater["default"]) and $v == $paramater["default"])

-----Original Message-----
From: Ron [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Forms


This is the first time that I have tried to conquer a form in PHP(which I
obviously am not doing) so that I can have a total PHP script page and move
away from HTML.

Here is my code as followed by my book (PHP Black Book) some variables have
been changed

<?

$group[] = "Communications";
$group[] = "Network Section";
$group[] = "Wire Section";
$group[] = "Phones";

$question["section"] = array("type" => "radio",
  "question" => "What section is this Trouble Ticket being opened for?",
  "list" => $group);




function form($page, $question)
  {
  $text = "";
  while(list($group, $v) = each($question))
    {

    if(strlen($text)) {$text .= "<BR>";}
    $function = "form_" . $v["type"];
    $text .= $function($name. $v);
    }
  return("<form action=\"ttsubmit.php" . $page . "\" method=\"post\">"
  . $text
  . "<input type=\"submit\" name=\"submit\""
  . " value=\"Submit\">"
  . "</form>");
}

function form_radio($group, $parameters)
  {
  $output = "";
  while(list($k, $v) = each($parameters["list"]))
    {
    if(strlen($output))
      {
      $output .= "<BR>";
      }
    $output .= "<input name=\"itsumit.php" . $group . "\"" . "
type=\"radio\""
      . " value=\"" . $v . "\"";
    if(isset($paramater["default"]) and $v == $paramater["default"])
      {
      $output .= " checked";
      }
    $output .= ">" . $v . "\n";
    }
  return($output);
}
//print(form ("tt.php", form_radio("group","parameters"));

When the last line is commented out there is no output at all.  When I
uncomment the last line I get a parsing error.
I have been trying to figure this out, but I really lost here!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to