Example #1
0
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
session_start();
require 'general_functions.php';
// Create headers + menu
create_site_top();
create_top_menu();
echo '<div class="poets_list">';
echo '<div class="textblock">';
echo '<h3>Runoiljat</h3>';
echo '</div>';
echo '<div class="inner_textblock">';
echo '<div class="poets_list_inner">';
// Get poets
$q = 'SELECT id, username FROM rs_users ORDER BY username';
try {
    $ret = $db->query($q);
} catch (Exception $e) {
    echo 'Virhe tietokantakyselyssä!';
    die;
}
Example #2
0
function show_register_form()
{
    create_site_top();
    create_top_menu();
    // Fields to add in form
    $fields = array('username' => 'text', 'password' => 'password', 'password_again' => 'password', 'firstname' => 'text', 'lastname' => 'text', 'city' => 'text', 'homepage' => 'text', 'birthdate' => 'text', 'email' => 'text');
    // Field names
    $field_names = array('username' => 'Käyttäjätunnus (*)', 'firstname' => 'Etunimi', 'lastname' => 'Sukunimi', 'password' => 'Salasana (*)', 'password_again' => 'Salasana uudelleen (*)', 'city' => 'Kaupunki', 'homepage' => 'Kotisivu', 'birthdate' => 'Syntymäpäivä (pv.kk.vvvvv)', 'email' => 'Sähköposti');
    echo '<div class="register">';
    // Show message if there is any.
    // For example message will be shown if user has changed
    // his/her profile.
    show_message();
    echo '<form action="register.php" method="post">';
    echo '<table>';
    // Add every field in the form.
    foreach ($fields as $key => $value) {
        echo '<tr>';
        echo '<td>';
        echo $field_names[$key];
        echo '</td>';
        echo '<td>';
        echo '<input type="' . $value . '" name="' . $key . '">';
        echo '</td>';
        echo '</tr>';
    }
    // "Rekisteröidy" -button.
    echo '<tr>';
    echo '<td colspan="2">';
    echo '<input type="submit" value="Rekisteröidy">';
    echo '</td>';
    echo '</tr>';
    echo '</table>';
    echo '</form>';
    echo '<p>Vain tähdellä merkityt kohdat ovat pakollisia.</p>';
    echo '</div>';
}