psf
 All Classes Functions Variables
login_form.php
1 <?php
2 
3 // Part of simple php framework (spf)
4 
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 
15 // Copyright (c) Petr Bena <petr@bena.rocks> 2015 - 2017
16 
17 require_once (dirname(__FILE__) . "/element.php");
18 
19 class LoginForm extends HtmlElement
20 {
21  public $Format = NULL;
22  public $Callback = "index.php?login";
23  public $User = "";
24  public $Pass = "";
25  public $Html;
26 
27  public function __construct($_parent = NULL)
28  {
29  parent::__construct($_parent = NULL);
30  }
31 
32  public function ToHtml()
33  {
34  $html = "<div class=\"loginform\"><form action=\"" . $this->Callback . "\" method=\"post\">\n";
35  $html .= " <p><input type=\"text\" name=\"loginUsername\" value=\"" .$this->User. "\" placeholder=\"Username\"></p>\n";
36  $html .= " <p><input type=\"password\" name=\"loginPassword\" value=\"\" placeholder=\"Password\"></p>\n";
37  $html .= " <p class=\"loginform_submit\"><input type=\"submit\" name=\"commit\" value=\"Login\"></p>\n";
38  $html .= "</form></div>";
39  return $html;
40  }
41 }