Weekly Recap for February 3

Lecture Notes

  • Student Gallery
  • Dreamweaver Efficiency Features – site links/files panel … spellchecker…css styles panel
  • Server Side Includes
  • PHP Contact Form & Autoresponder

Assignments

  • Project 2: Contact form and Autoresponder in PHP – Start with the tutorial and use your own creativity to develop a well styled dynamic Contact Form and Autoresponder.   Incorporate the form into your Project 1 page.    Come up with your own selection choices and response content – ie web design or some other business.   We will continue to enhance this example in future projects.  Your grade will be based on how much you enhance the basic bare-bones example with features (business rules) and style.  Feel free to create more comprehensive forms that gather additional data, which can be included into your business rules.
  • Quiz 1 This is a short quiz on basic PHP concepts. There is a one hour time limit and it will be open through Wednesday at midnight.

11 comments for “Weekly Recap for February 3

  1. February 7, 2011 at 3:49 pm

    On the contact form I made I put some artists. I would like to make it so on each of the responder pages a file with images of the particular artist’s work appears. I’m guessing it would be an include. But, I can’t figure out how to make the autoresponder.php include a different file for each artist on their individual page. It seems similar to the code used here:
    but I can’t figure out how to do it!!
    Thanks,
    L

  2. February 7, 2011 at 3:50 pm

    Hmmm……so, the code I pasted in there didn’t get into the comment. I am referring to the “switch” code used in the autoresponder.php that cleverly finds the correct -responder file to load.

    • February 7, 2011 at 4:56 pm

      First, if you want to insert code into a comment, you need to use the CODE and /CODE tags. You have to be a little careful when you insert php tags, I suggest that you omit the PHP tags and just use the CODE tags in the wordpress editor.

      Second, it looks like you have the page working, so you may have figured this out already. You are correct, the SWITCH … CASE statement in autoresponder.php is what assembles the resulting page. The SWITCH clause contains the conditional subject, in this case the variable holding a user’s preference; and the CASE clause contains the conditional state, in this case the actual value of the user’s preference. You can include or omit the BREAK; statement, omitting it in cases where there could be more than one conditional state.

      The actual page content is in the include files that are called in autoresponder.php. You must of course have a file created for each condition.

      A pretty simple concept, but a very basic and ubiquitous technique that used throughout dynamic web applications.

  3. February 7, 2011 at 7:21 pm

    I got the artist-responder pages to work just fine. But, what I’d like to also do (maybe it’s not a good idea) is to be able to call up the appropriate images for each artist to appear on their individual page. So, for instance, on the okeeffe page, have her images show on the right instead of the file with the three images of all the artists (prints.php). On the van gogh page, have his images appear on the right. And, on the chagall page, his images. Is the possible?
    I think it would need a php thingy in the autoresponder.php in the sidebar2 div where the prints.php include is. That’s what I can’t figure out.

    • February 7, 2011 at 8:01 pm

      You can do this very easily, simply place specific images in each of the different artist include files. I used the background-image attribute in the example, but you can also use the IMG tag.

  4. February 7, 2011 at 9:33 pm

    Right, I realize that I can place the specific images in each of the different artist files. I was wondering if it is possible to put a “switch” “case” thing. That way, if there were several pages for each artist the image file could be called for each artist. Maybe it’s just not a good idea. Or, maybe I can’t explain myself.

  5. February 8, 2011 at 7:31 am

    Maybe I don’t understand the question, but yes, in general, you can use PHP throughout a website to build pages dynamically. As in most programming, it’s a good idea to think about it beforehand and take a logical approach in how you implement it.

  6. February 8, 2011 at 7:37 am

    Thanks, Jay. Maybe I can explain what I’m thinking during the lab hours on Thursday.
    L

  7. Kathy Samoun
    February 8, 2011 at 8:20 pm

    Did anyone else have an issue with the 4th question on the quiz? the 1st and last multiple choice answers were blank when I took the quiz..

  8. February 8, 2011 at 8:44 pm

    Yes, sorry about that. It should be fixed now, but the question won’t count either way. The tags were causing problems with the test system.

  9. Micah Gemmell
    February 10, 2011 at 5:47 pm

    I wanted to let people know that a sitemap in dreamweaver CS5 is still possible, but it is hidden in the preferences file. you need to reg.edit it.

    Mac: I used this video, and it wasn’t too hard to do.
    http://www.youtube.com/watch?v=60cbfLm5pDg

Comments are closed.