Friday, May 21, 2010

Questions

1) Why doesn't it work to put the "require" statement in header_inc instead of in the config area of each page? I get an error that says get_header() is undefined.

2) Same question for $PageTitle.

3) Same question for $sql that is needed on every page (like a universal menu that appears on each page referencing database items).

4) How do I build my own "if" statements referencing data in the database? ie - if ['Genre'] == Short Story, then display ['Title']...where Genre and Title are database fields.

5) What statements, definitions, variables etc. are absolutely required to make a successful reference to the database? [I am thinking a neat list/diagram would make this much clearer]

5) Why is the $ dropped when referencing variables/properties defined within a class?

6) Is the difference between __construct() and the method just that the method is conditional and __construct() happens no matter what?

7) What is the difference between $selSQL and $SQL?

8) Can I delete the .TGZ file for A7 once it is unpacked?

9) There was mention of a trick that helps to not need an index file in every folder to prevent directory browsing - will this be discussed in class? (I think it is ht_access.)

10) How do I know when to use var, private, or public when defining a property within a class?(The Classes/Paging Lesson example for extending a class uses var, but when the parent was created private and public were used instead. While I understand that a public property is available outside of the class and private is not, I don't understand why var is used in the child.)

11) In the Class Classes/Paging Lesson example for extending a class the variable/property $is_price_negotiable is created but not defined and then passed through the method. Why couldn't the previously created $negotiable_price just be set to TRUE? Why is it necessary to create a new variable or property?

12) If the property is created in the class and not defined, is it defined later or was it already defined somewhere else? How is it stored (ie-in the mysql database?)? Is the lesson automobile example envisioning a form that the enduser fills out or are there dropdown menus with values for these properties? What is the context of the automobile example and what might the interface and output look like?

13) Should every class be defined in separate _inc.php document like Pager_inc.php? Would you ever define in config?

Monday, May 17, 2010

Homework 7 and Lessons

Travelling through a wrench into my week. Having the ability to view lessons online was very helpful. I uploaded the assignment 7 sql file through phpMinAdmin and updated the require statements in the list and view files, but still have to customize it for my site. My client hasn't sent me his files so I may need to make fake files for the assignment.
Listening to the 5/12 lesson, reading the lesson documentation, starting the homework, and completing the test was all done on the 5hr 20min flight from NJ...minus take off/landing and snack break.

Sunday, May 16, 2010

PHP Documentor (extra credit)

I added PHP Documentor. This doesn't seem like a good thing to load in the root, but maybe I'm wrong? The "files" option reveals the physical path for the config. This seems like a major problem to me, unless the there is a way to conceal it. Also, why would I want to parse my inc files located outside of the root? They contain all of the information we've been trying to protect. This seems like a major security risk.
Would love some feedback on this. I didn't parse my inc file outside the root for the reason above.
Adding PHPDocumentor took me about an hour to do. I was confused about adding the .ini file. Not sure I understand it's purpose, but I created and it's in the user file.

Homework 6 (continued)

Homework 6 was successfully loaded to Zephir. Now working on loading it on Dreamhost. Questions:
1) Do I set up I actually enter the username and password for the if() switch and admin/delete/insert/update/select?
2) If yes, are the usernames and passwords all the same as the mysql usernames and passwords?
3) Should I go ahead with a prefix? The lecture indicated that it makes things complicated in the string, but it also makes it more secure.
4) What are the crazy characters in the functions in Common? Do I change these?
5) Do I do anything with Common at this point?

Everything is successfully running on Dreamhost. Looks good. All permissions set up correctly. After reviewing the lessons from this week the purpose of each file is much clearer. Hopefully, the documentor loads smoothly.

Correcting homework 6 didn't take very long. I mainly needed to fix my permissions and adjust my file paths for files existing outside of the root. Maybe an hour.

Sunday, May 9, 2010

Homework 6

This was the most challenging assignment yet. I wasn't able to get it successfully running on Dreamhost. So I ended up putting it on Zephir. Once on Zephir, I couldn't get it to incorporate the css. I tried using the "get_html" method as well as the standard style tag with URL@. I put the CSS in a number of different folders and it still doesn't work. I have tried entering the path absolutely and relatively and it still doesn't work. Everything else still seems to be working, but I don't feel great about. I feel like the assignment was very confusing and I felt unclear about what I was even doing. More than anything I just feel like my code is now a big mess with a lot of foreign stuff I dumped into it and I don't really understand a lot of it.
I think my big issue with making this assignment work in Dreamhost was that I don't understand how to refer to files that are stored outside of the root, like header_inc and footer_inc. While I see how this is done with Zephir I wasn't successfull in translating to Dreamhost.
I'm going to listen to the lecture again and re-read the lesson, but I think I really need help with this. I re-did the assignment several times and feel a little lost.

Wednesday, May 5, 2010

Homework 5

Completed this assignment in class - installing phpMinAdmin. I installed on both Zephir and Dreamhost. Both work. Yippee! The Dreamhost installation took about 2 seconds (simply uploaded to the root). Uploading to Zephir was pretty easy, with the corresponding how-to.

Sunday, May 2, 2010

Lessons & Homework Week 4

This week we dove into UNIX and MySQL. Accessing Terminal on the Mac was very easy. I had some short correspondence with Dreamhost to make sure I configured access to the command line appropriately. It all went swimmingly. I will definitely need to keep a glossary of commands for MySQL and utilize online resources. There is no way I will remember all of them, but repetition will help.
The lessons and book reading took about 2-3 hours to complete this week. The homework was started in class. It took me an additional 1.5 hours to complete because I decided to fiddle around with the CSS and nix the table the form was set into. I was having a very difficult time centering the reCaptcha iframe. It wouldn't respond to margin:0 auto; or text-align center. I was finally able to center by setting specific right and left margins. I am sure there is a better way. I didn't want to mess anything up in recaptchalib.php so I stopped playing once I got it to look ok.
The only other issue I encountered is that my template.php guts included a background image in the CSS that I didn't know how to undo for other pages in the site. So I took the image out of the CSS and put the image tag in the template.php file so it wouldn't appear in contact.php.
I dig reCaptcha and eager to add it to my own website. Hopefully will get that done tonight along with applying the php for changing title tags and highlighting the active navigation that was taught in the reading from the book. I was wondering how that was done and excited that it was included in the reading.