NTKForm.php 880 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. class NTKForm
  3. {
  4. function NTKForm($id, $action = "", $elem = Null)
  5. {
  6. $this->id = $id;
  7. $this->action = $action;
  8. $this->elem = $elem;
  9. $this->attributes = array();
  10. $this->style = "";
  11. }
  12. function addAttribute($attribute, $value)
  13. {
  14. $this->attributes[] = array($attribute, $value);
  15. }
  16. function getHtml()
  17. {
  18. $html = "";
  19. $html .= "<form name=\"".$this->id."\" action=\"".$this->action."\" method=\"post\" style=\"".$this->style."\">\n";
  20. for($i = 0; $i < count($this->attributes); $i++)
  21. $html .= "<input type=\"hidden\" name=\"".$this->attributes[$i][0]."\" value=\"".$this->attributes[$i][1]."\">\n";
  22. if($this->elem != null)
  23. $html .= $this->elem->getHtml();
  24. $html .= "<input type=\"submit\" value=\"\" style=\"visibility: hidden; position: absolute; width: 0px; height: 0px;\">";
  25. $html .= "</form>\n";
  26. return $html;
  27. }
  28. }
  29. ?>