Friday, April 24, 2009

Wireframe for Final Project

Will probably refine further, but here's what I'm thinking:

Above the fold:


Below the fold:

Blog Homework Week 9

Still tough for me, but I'm determined to get this. Slowly but surely. Got the login and registration to work (checking password and username, writing to database, and adding cookie to index page). So here's round 2, to be continued ...

http://onepotcooking.com/annmariegatti/class9/blog_rev/register.php

Friday, April 17, 2009

Blog Homework (week 8)

Well, I'm getting there, slowly but surely. I think if I spend more time with this, I will eventually 'get' it. I still don't have everything functional though. My biggest issues are:

1) Can't seem to get anything to write into the MySQL database. Anything I type into the blank fields seem to go 'nowhere'. Had a similar problem last week when writing to a text file (but it turns out I didn't re-upload the text files) -- however this time I tried refreshing the MySQL site and that didn't solve the problem.
2) I finally got error messages to appear when someone doesn't enter their username and password -- however, now the error message comes up no matter what (even if they enter their username and password). This is the opposite version of the trouble I had last week!
3) I keep getting a foreach argument error on my index page. I'm not sure why because I literally cut and pasted the code from Amos' example.

Since the site isn't fully functional yet, I am posting my separate pages:

Login-in page
Register page
Create new blog post page
Edit blog post page
Index page

I would really love to get this blog up and running, so any insight/direction/help regarding any of the above would be greatly appreciated!!!

Last Week's Homework

I just want to go on record saying that I had done my homework correctly last week -- in as far as it turns out that the verbiage WAS writing to my text page. I just couldn't see any text on the page no matter how I changed/adapted/played-with my html and php -- because I never re-uploaded the text files!!! Sad to say, I wasted 6 hours going around in circles and didn't figure it out until I was in class on Saturday and downloaded my files from the server and saw all those usernames and passwords I had entered during all my troubleshooting! Anyway, unfortunately because of that roadblock, I didn't complete the password verification steps last week -- which I will attack next week. I wanted to concentrate this week on the new 'create a blog' assignment -- although once again I will admit that this (at least for me) is a massive and intricate project no matter how much cut-and-pasting I do.

Friday, April 10, 2009

Class 7 Homework (Assign 6?) IMAGE UPLOAD SITE

Well, I hate to say it but once again, this was a very difficult assignment for me. I thought I understood it -- particularly how to 'marry' the registration page with the process_register page and marry the login page with the process_login page -- however, I can't seem to get any information written to the users.txt files. I've tried looking through all my notes, through Amos' examples, through the book "PHP Visual Quickstart Guide" and watching the KillerPHP.com videos. My code seems logical, and it seems to align with everything I've read -- but I'm obviously missing 'something' (I just don't know what it is). Also, I can't seem to get the 'error' messages to appear/pop-up (i.e. Login Failed) on the page. I had to 'cheat' and recreate pages called register_fail.php and login_fail.php (which were replicas of their original pages, with an error message added). Since I can't get anything to write onto the users.txt page, I'm stuck with what to do with the login page (looping through passwords). I've been going round in circles since Sunday night, so I'm just about to give up. I'll try tonight to at least tackle the file upload page, but in the meantime, here are links to my register and login pages:

Register Page
Login Page
Register Fail Page (can't get to write to users.txt file)
Login Fail Page
Index Page (not functional yet)
Image Upload Page

Here's a sample of my code -- again not sure what I'm doing wrong:

PROCESS REGISTRATION PAGE:

/*
$username = trim ($_REQUEST['username']);
$password = trim ($_REQUEST['password']);

$handle = fopen ("users.txt", "a");

$register_info = "Username is {$username}, Password is {password} /n";

if ($handle) {
if ((!empty ($username)) && (!empty ($password))) {
fwrite($handle, $register_info);
header ("Location: login.php");
}

else {
echo "Please enter username and password.";
header ("Location: register_fail.php"); //re-direct to re-register page
}

}

fclose($handle); //close the file

*/

Friday, April 3, 2009

REVISED Homework #5 (HOMEWORK 6?)

Okay!

I was finally able to clean up my mouseout and mouseover homework.

For the html code, I created a parent div around both the image and the info div (which actually made perfect sense to me -- finally!). However, that still didn't fix the problem - which was extremely frustrating. After much careful and sometimes 'foggy' thought, I realized that I needed to re-think my PHP code to ensure that it was 'married' correctly to my new html code. That said, (and I'm hoping I'm using the correct verbiage here)I changed the ID of my mouseover/mouseout functions to align with the ID of my newly-formed parent divs -- which seemed to do the trick.

Fortunately I was able to get this homework functioning. Unfortunately, I'm still somewhat foggy on the overall logic/concepts. But I will, of course, continue to study and forge ahead...

Here is the link to my revised homework:

http://onepotcooking.com/annmariegatti/class6/cd_store.php