Tag: php

  • PHP register new user

    So I’m continuing on my user account management quest. Yesterday and today I added the ability to register as a new user. It’s still very rudimentary- the registration fields are not checked for validity (so more than one user can have the same user name) but I feel great that I’m making progress. Try it out: http://yukikodesign.com/test/testbed/index.php

    Next up, send an email when “forgot password” and add personal account management to change passwords and delete users if you’re an admin.

  • PHP user login test

    A huge step for me in programming- I got a simple user authentication to work through php. It took some stretching and “feeling my way through the dark” but I got something that requires a login and logout and it seems to work. The SQL database stuff was a bit of a fanagle since it veered off from my book but this time I looked around and was able to “upload” my queries instead of typing them out in a command prompt. I’ll work on it a bit more later but it’s sleepy time.

    links:
    My Quick and dirty test
    User: jack
    Pass: toronto

    Book reference: PHP Hacks- Tips & tools for Creating Dynamic Web Sites
    Online Tutorial: Simple Login, Logout, and Session Handling

  • Php and html minitips

    Set your site’s base (all links will think of it as the site root)

      Say your page is located at:
        yukiko/pages/news/IGotAJob.html
      In your page’s <head> tag put the root page:
       <base href=”yukiko/index.php”>
      So instead of linking relative to the page,
       <img href=”yukiko/index.php” src=”/images/janitor.jpg” />
      a link will be relative to the site root.
       <img href=”yukiko/index.php” src=”yukiko/images/janitor.jpg” />

    Dump another html file into the current php file:

      <?php include “header.html”; ?>

    Good site setup (for me at least):

      yukiko/

      • pages/
        • header.html
        • footer.html
        • page1.php

      • css/
        • header.css
        • footer.css
        • style.css
        • index.css
        • page1.css

      • images/
      • index.php