Saturday, April 6, 2013

A dissection of Robins Nest

  • index.php
    • Uses:
      •  rnheader.php
    • Purpose:
      • prints to screen Welcome, please sign in or sign up to continue
  • rncheckuser.php
    • Uses:
      • rnfunctions.php
    • Purpose: 
      • Checks if username is available, prints the results to the webpage
  • rnfriends.php
    • Uses:
      • rnheader.php
    • Purpose: 
      • if user is not logged in
        • Will send  a "You must log in" web page
      • fetch the users friends
        • puts followers into an array
        • puts mutual friends into an array
        • puts friends into an array
  • rnfunctions.php
    • Uses:
      • None
    • Purpose:
      • provides functions for the SQL interface 
    • Functions:
      • Create Table
        • createTable($name, $query)
        • echos table already exists, or creates table $name
      • Table Exists
        • tableExists($name)
        • returns the number of rows as a result of the query: Show Tables Like '$name'
      • Query MySQL
        • queryMysql($query)
        • Queries the database
        • returns the result
      • Destroy Session
        • destroySession()
        • destroys the current session
      • Sanitize String
        • sanitizeString($var)
        • sanitizes tags, html entities, and slashes to prevent SQL injection attacks
        • returns mysql_real_escape_string($var)
      • show Profile
        • showProfile($user)
        • if picture had been uploaded, puts picture on screen
        • displays user information saved in the database
  • rnheader.php
    • Uses:
      • rnfunctions.php
    • Purpose: 
      • calls session_start()
      • if user is logged in,
        • displays links for navigation
        • Home
        • Members
        • Friends
        • Messages
        • Profile
        • Log out
      • if user is not logged in,
        • Home
        • Sign up
        • Log in
  • rnlogin.php
    • Uses:
      • rnheader.php
    • Purpose: 
      • gets $user and $pass
      • sanitizes the strings
      • gets checks username / pass against the database
      • if correct prompts the user to click on link
  • rnlogout.php
    • Uses:
      • rnheader.php
    • Purpose 
      • calls destroySession()
      • logs the user out
  • rnmembers.php
    • Uses:
      • rnheader.php
    • Purpose: 
      • if user is not logged in, users are denied access
      • view users profile
      • add a friend
      • remove a friend
      • displays other members and their friendship status
  • rnmessages.php
    • Uses:
      • rnheader.php
    • Purpose:
      • if user is not logged in, users are denied access
      • provides information on when information was viewed
      • provides creation of messages
      •  erasing of messages
      • editing of messages
  • rnprofile.php
    • Uses:
      • rnheader.php
    • Purpose: 
      • if user is not logged in, users are denied access
      • provides the editing of profile
      • provides uploading of images as the user profile
  • rnsetup.php
    • Uses:
      • rnfunctions.php
    • Purpose 
      • creates the tables needed in the database
  • rnsignup_yui.php
    • Uses:
      • rnheader.php
    • Purpose:
      • javascript that checks username input
      • logs out user if already logged in
      • checks to see if both fields were entered
      • checks if username already exists
      • adds user to database
  • rnsignup.php
    • Uses:
      • rnheader.php
    • Purpose:
      • javascript that validates user input
      • creates a user based on input

6 comments:

  1. Quite a bit to scroll through.

    ReplyDelete
  2. nice post
    http://php4unow.blogspot.com/

    ReplyDelete
  3. How useful, I could always use a reference.

    ReplyDelete
  4. Good work, should help with the final project.
    Check out my blog if you have not already: http://pmickplace.blogspot.com

    ReplyDelete
  5. A bit of scrolling, but pretty useful. Nice job Jordan.

    http://easyhtm.blogspot.com/

    ReplyDelete