Final Outline

What is Needed?

I looked at our final and tried to devise a plan on how things were created and implemented into a webpage. As I looked over the items needed (search bar, comments section, this ouline), I tried to realize what I had already installed or used in my site. I knew that I was going to need a (item #1) user login feature. I had already created the registration page and had a login page. However, the login page was not always accessible. That needed to happen. The login must be always visible if a user is not logged in. Then I had to figure out where to put the login. I found that on my site, the "navigation bar" was the easiest place to put it. It was the most accessible and least cluttered. Also, since the navigation bar is always shown and the same on every page, it makes it that much easier to use and fix (if ever broken). I got the login device working and decided to switch pace a bit. I worked on my (item #2) search bar. The search bar I really had no clue where to start with something like that. I was under the understanding that we needed to use the meta information for the search fields, but I didn't know how to actually implement that. I did some searching online and I found an article that explained how a search feature worked. I found that it was just a database table that had fields a record set would search through with a certian word. I learned the search basics and implemented that into my site. Easy enough. The last portion was what I was putting off until the end because I was lost on a certain aspect of it. The (item#3) comments section seemed like an easy enough idea. But then we had to implement the login feature with it. This is where I started going crazy.

Problems?

The comments section brought on the most difficulty for me. It wasn't actually creating the comments that was hard, it was getting the pages to recognize that a user was logged in and THEN let them comment on the pages. I couldn't, for the life of me, understand how a session recognized the users. I did however had a very helpful friend who sat with me and helped me understand session variables and cookie variables. It was a tremendous help. I took that information and created session variables that allowed me to understand who was logged in. With that information, I was able to call for information from the database tables and get information about that user of which I could then use on the page if I wanted. I also was able to know whether a user was logged in or not. With all of this, the comments section became a much easier path to go down. Below, I listed the creation outline.

Outline

  • Look at requirements
  • Determine what was needed that I didn't already have
  • Create Login mechanism
  • Create Search mechanism
  • Try to understand session variables and their usage
  • Create Comments section
  • Troubleshoot and debug

How I did it

For the search bar, I had to create a new database that would store page titles, page descriptions, and the page url's. I created a form that the admin of the website would enter in each pages' information. So the search database become self created and maintained. I then created the search box that is in-laid in the header. Every page has access to the search function now. The search function actually works by passing the word(s) someone is searching for into a page that uses them as a filter and search feature. The result page uses the word(s) to filter a recordset that then displays all the pages that the word(s) appear in. In the end, the page then displays all of the database pages that have the search word(s) present in the title or description. That was the creation of the search feature.

The comments section became quite easy once I learned how to create session variables. I used session variables to determine when to show certain parts of the comment area. The comments are displayed in a table style where a title and comment are displayed followed by the user name of the poster and the time it was posted. To implement all of this, I had to create another table. This table has a title field, comment field, user name field, date posted field, and a page displayed field. When a user is logged on to the site, the assignment pages display a form that allows them to leave feedback about the page. Every page's feedback is stored in the same table, thus we had to distinguish which page it was created on so we could display on comments ment for that page. When the user posts his/her comments, there are hidden fields that keep track of the user's name via session variables that were created by a recordset using that person's credentials to get their name. The hidden fields include the user name and the page that is being posted to. When the user posts the comment, all are stored into a table and a posted time is also stored. The page then refreshes and displays the comments followed by the new comments. Some day I hope to allow people to comment on other people's comments, and not just the page itself.

Search table fields

  • ID
  • Page Name
  • Page Description
  • Page URL

Feedback table fields

  • ID
  • Comment Title
  • Comment
  • User Name (via session variable)
  • Page Name
  • Date Posted

Comments and Feedback?

To leave comments or feedback about this page, please login using the side bar. If you do not have a login, please register.