First:  cross-posting to multiple lists...not nice.  Most PHP folks are on
both lists.
Second: your first sentence seems to indicate that unknowledgeable people
inhabit the PHP list, vice the PHP-DB list.  Hmmmm.... <GRIN>
Third: what error do you get when you get the parsing error?

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

I know this is suppose to be databases, but the most knowledgeable people
seem to be in here.

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"]))
      $output .= "<BR>";
    $output .= "<input name=\"itsumit.php" . $group . "\"" . "
      . " value=\"" . $v . "\"";
    if(isset($paramater["default"]) and $v == $paramater["default"])
      $output .= " checked";
    $output .= ">" . $v . "\n";
//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 Database Mailing List (
To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to