align-toparrow-leftarrow-rightbackbellblockcalendarcamerachatcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-crosscrosseditemptyheartfacebookfullheartglobegoogleimagesinstagramlocation-pinmagnifying-glassmailmoremuplabelShape 3 + Rectangle 1outlookpersonplusImported LayersImported LayersImported Layersshieldstartwitteryahoo

Boston PHP Message Board › Chapter 02: PHP Percolate! Season 6

Chapter 02: PHP Percolate! Season 6

Gene B.
Boston, MA
Post #: 2,227

Welcome to the Chapter 2 discussion area for PHP Percolate! Season 6. Please read the chapter, complete the tutorials and post a link to your completed work. Then, let your fellow percolators know how you are progressing by clicking the Add a reply link.

Return to >> Master Discussion List
Peter P.
Bonita Springs, FL
Post #: 9

Results for Chapter 2.
Trying to get to the finish line this time!!!

Gene B.
Boston, MA
Post #: 2,245
@Peter -- Nice work showing us the way!
A former member
Post #: 58
In script 2.6, I tried generating the month pull-down menu without accessing both the keys and values, but using the same data for the option’s value and label (the name of the months), which looks like this:

// Make the months pull-down menu:
echo '<select name="month">';
foreach ($months as $value) {
echo "<option value=\"$value\">$va­lue</option>\n";

And it still works well. Each execution of the loop will create a line of code like <option value="January">January<­/option> instead of <option value="1">January</optio­n>

Why should we complicate it, right?
A former member
Post #: 59
In script 2.6, if you want to get the current date from the server for the $years array instead of using a certain/unchangeable/concrete value, i.e. as of 2011, to fetch with your loop iteration, you will be able to create the array for it like this:

$today = date('Y');
$tomorrow = $today + 10;
$years = range ($today, $tomorrow);

Any other suggestion will be appreciated!
Mike M.
Seabrook, NH
Post #: 67
Hi Gene. Here is an attempt at the chapter two exercises and review. To keep in practice, I completed some of the forms a second time using QuickForm2 (from the last PHP-OOP season).
Gene B.
Boston, MA
Post #: 2,253
@Mike -- Impressive work here. You've earned the Silver Percolator for this week!
Jim R.
Brooklyn, NY
Post #: 5
Gene B.
Boston, MA
Post #: 2,264
@Jim -- Nice work. I'm glad to see our "out-of-towners" are taking an early lead. smile
David P.
Boston, MA
Post #: 60
@Gene..........Ch2...complete...working on end of chapter exc....nextcool
Powered by mvnForum

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy