webserver/htdocs/singlefilelogin.php
/**
     * Simple demo-"page" with the registration form.
     * In a real application you would probably include an html-template here, but for this extremely simple
     * demo the "echo" statements are totally okay.
     */
Simple demo-"page" with the registration form.
In a real application you would probably include an html-template here, but for this extremely simple
demo the "echo" statements are totally okay.
Simple demo - " page " with the registration form . In a real application you would probably include an html - template here but for this extremely simple demo the " echo " statements are totally okay .
private function showPageRegistration()
    {
        if ($this->feedback) {
            echo $this->feedback . "<br/><br/>";
        }
        echo '<h2>User registration</h2>';
        echo '<table><form method="post" action="' . $_SERVER['SCRIPT_NAME'] . '?action=register" name="registerform">';
        echo '<tr><td><label for="login_input_username">Username (letters&numbers, 2-64 chars)</label>';
        echo '<td><input id="login_input_username" type="text" pattern="[a-zA-Z0-9]{2,64}" name="user_name" required /></tr>';
        echo '<tr><td><label for="login_input_email">User\'s email</label>';
        echo '<td><input id="login_input_email" type="email" name="user_email" required /></tr>';
        echo '<tr><td><label for="login_input_password_new">Password (min. 6 characters)</label>';
        echo '<td><input id="login_input_password_new" class="login_input" type="password" name="user_password_new" pattern=".{6,}" required autocomplete="off" /></tr>';
        echo '<tr><td><label for="login_input_password_repeat">Repeat password</label>';
        echo '<td><input id="login_input_password_repeat" class="login_input" type="password" name="user_password_repeat" pattern=".{6,}" required autocomplete="off" /></tr>';
        echo '<tr><td><input type="submit" name="register" value="Register" /></tr>';
        echo '</form>';
        echo '<a href="' . $_SERVER['SCRIPT_NAME'] . '">Homepage</a>';
    }
private function showPageRegistration ( ) { if ( $ this -> feedback ) { echo $ this -> feedback . " <br/><br/> " ; } echo '<h2>User registration</h2>' ; echo '<table><form method="post" action="' . $ _SERVER [ 'SCRIPT_NAME' ] . '?action=register" name="registerform">' ; echo '<tr><td><label for="login_input_username">Username (letters&numbers, 2-64 chars)</label>' ; echo '<td><input id="login_input_username" type="text" pattern="[a-zA-Z0-9]{2,64}" name="user_name" required /></tr>' ; echo '<tr><td><label for="login_input_email">User\'s email</label>' ; echo '<td><input id="login_input_email" type="email" name="user_email" required /></tr>' ; echo '<tr><td><label for="login_input_password_new">Password (min. 6 characters)</label>' ; echo '<td><input id="login_input_password_new" class="login_input" type="password" name="user_password_new" pattern=".{6,}" required autocomplete="off" /></tr>' ; echo '<tr><td><label for="login_input_password_repeat">Repeat password</label>' ; echo '<td><input id="login_input_password_repeat" class="login_input" type="password" name="user_password_repeat" pattern=".{6,}" required autocomplete="off" /></tr>' ; echo '<tr><td><input type="submit" name="register" value="Register" /></tr>' ; echo '</form>' ; echo '<a href="' . $ _SERVER [ 'SCRIPT_NAME' ] . '">Homepage</a>' ; }
Simple demo-"page" with the registration form.
Simple demo - " page " with the registration form .
//if (empty($_SESSION['user_name'])) return; //if (!$_SESSION['user_is_logged_in']) return; //if ($_SESSION['user_name']!=='admin') return;