Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

PHP

Name: Anonymous 2012-01-07 17:53

Is there a cleaner way to do this?
 
 
<?php
    if ($this->session->userdata('logged_in') != '') {
       echo "Welcome, ".$this->session->userdata('logged_in')."<br/>";
       echo anchor('login/logout/', ' Log Out');
    }
    else {
        echo "<p>";
            echo form_open('login');
                echo "<label for='username'>Username:</label>";
                echo "<input id='username' type='text' name='username' />";
                echo "<label for='password'>Password:</label>";
                echo "<input id='password' type='password' name='password' />";
                echo "<input type='submit' value='Login' />";
            echo "</form>";
            echo "<br/><br/><br/><br/><br/><br/><br/><br/><br/>";
            echo 'It is: ' . date('l jS F Y g:i:s A e ');
        echo "</p>";
    }
?>

Name: Anonymous 2012-01-09 0:33

I think this is what you are looking for OP.

(write-html-tree-to-stdout
  (if (not (eq? ((userdata (session this)) "logged_in") ""))
    `(text "Welcome, " ,((userdata (session this)) "logged_in") (br)
           ,(anchor "login/logout" " Log Out"))
    `(p ,((form "login") (label ((for "username")) "Username:")
                         (input ((id "username") (type "text") (name "username")))
                         (label ((for "password")) "Password:")
                         (input ((id "password") (type "password") (name "password")))
                         (input ((type "submit") (value "Login"))))
        ,(times 9 '(br))
        (text "It is: " ,(data "l jS F Y g:i:s A e ")))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List