Skip to content

Week 7 Extra Credit Questions

October 8, 2011

Now that week 7 is over, I wanted to ask for input on the extra credit.

For the extra credit on the form, did anyone attempt to use check boxes where you can have multiple selections? I tried this, but I could not get the output to work correctly. It just kept showing up as “array”. I could not figure out how to have the multiple selections parse out in the table or in the output.txt file. Did anybody else run into this issue? If so, how did you get around it?

For the persistent link that appears everywhere except the homepage, I feel like I did a cheap work around. Basically, I created a separate nav include file specifically for the homepage. I don’t like this method because it defeats the purpose of having the include file. Now I have two files to modify if there are any navigation menu changes. It seems that I should have been able to come up with some sort of “if-else” code based on the page name or something. For example “if homepage, then use this set of  links else use these”. But I could not find the right resource and again ran out of time to make it happen the way I had envisioned. Anyone care to share how they did it?



2 Comments leave one →
  1. October 8, 2011 3:35 pm

    I did the same thing you did with the nav file…I’m sure there’s a more efficient way but I haven’t really looked into it yet…

  2. derek permalink
    October 12, 2011 8:10 am

    The use of separate include files is the right way to approach that issue. On the use of the checkboxes or radio buttons, the issue is that the possible value is on of a [set] and the code must iterate through the possible values to collect the selected value and check to see if any value is selected. In PHP it’s fairly sophisticated technique to test with the is_array() function, examine each set member and then act on that result. This is why we generally use error checking in the browser and what we will cover this evening.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: