trysh's cre8Buzz Blog

1 2 3 ... 23
Just "One Good Thing" Wednesday Posted 1 day ago
digg
delicious
stumble
reddit

Deliberately waited today....hoping to find a glimmer of a 'good thing' laying around somewhere...this has not been the best of weeks - so far!

But....these IS always a 'good thing' - even if you have to hunt for it - I hunted and found two -
One: My fever is again gone - and I'm going to believe it's for good

Two:  I did my 15 minutes of PHP and it actually FIT in the 15 minutes!


Two more days in this week....lots of time for it to go from 'iffy' to great!

1 comment

PHP - Day 34 - May 14 Posted 1 day ago
digg
delicious
stumble
reddit

Another shaky day here in Virginia.....will this junk never go away? But, I did not let it deter me from finishing up the lesson in PHP.

Today's progress:
Continuing on my adding and testing from yesterday - get this done and out of the way first!

July added - tested - and it works! I could get a big head with all this stuff actually
working!
August added - tested - and it works!
September added - tested - and it works!
October added - tested - and it works! I’m getting giddy from all this success!
November added - tested - and it works!
December added - tested - and it works!

Ok - that is all the months, and all the ‘elseif’ conditionals. I understand the structure, so I may go back to the ‘nested ‘ conditional lesson - and go over it again, now that I’ve done this one. I know they’re not exactly the same, but my understanding is better.

And…believe it or not - that’s it! The testing I’ve been doing all along is the finishing touch of this lesson, to print out what sign you are according to the date you choose for a birthday. Cool!

Dressed up the print out a little bit - still goes against the grain to format in the HTML code - even if it is inside the PHP tags!

You can try it out for all twelve months right here!:

www.shimmershine.net/register.php

0 comments

PHP - Day 33 - May 13 Posted 2 days ago
digg
delicious
stumble
reddit

Slowly getting back to normal - so getting back to my PHP studies was important - even if I couldn't actually finish an entire example.

Today's progress:

Using “elseif”

This is similar (uh oh) to the “if-else” conditional we have already studied. Now to see if I fare better with this than with the nested conditionals.

An example: If (condition1) {
statement(s);
} elseif (condition2 {
other statement(s);
}

You can add an “else” conditional at the end of an “if-elseif” conditional, but you have to remember it should be the last thing. This is the ‘default’ behavior, if none of the condions in the code are TRUE. There is, however no limit to the number of “elseif” conditionals you can use.

Hoo boy - the example is a long and complicated nested conditional to find the registering user’s astrological sign. I failed totally with this before, but maybe doing this one will give me the insight to see what I was doing wrong with the other.

This uses the existing “handleReg.php” page I have already made, but just adds to it.

After all the existing code, but before the closing PHP tag, we build our new conditional.

Here goes: if ($month == 1) { //This is January

        if ($day <= 19) {

$sign = "Capricorn";
} else {

$sign = "Aquarius";
}
}


print "Your astrological sign is $sign";

This basically says - if you chose January for your birth month, and the day was the 19th or before, then your sign is Capricorn. Otherwise, your sign is Aquarius.

Testing this baby out piece by piece - so added that “print” command and uploaded it. Tested it, and it worked!

Now to add more - the code for each of the month-day combinations is essentially the same, only differing in the day range and the sign - so I’m not
putting them in here - too repetitious and long - but I will test each bit as I go.

February added - tested - works!
March added - tested - didn’t work - I had spelled elseif as elesif - presto - blank
page. Corrected that - tested again - works!
April added - tested - works!
May added - tested - works!
June added - tested - works!

And I know I should do more….but I’ve run out of steam for today….and this has taken way more than my daily 15!

You can test out the astrological sign thingy as long as you stay in the months already coded - I found it really interesting that I could just make up the $sign variable on the fly as it were.

Check out the progress here:

www.shimmershine.net/register.php

0 comments

I Just Hate It When I'm Sick... Posted 3 days ago
digg
delicious
stumble
reddit

It came out of the blue...maybe I'm just run down with the multiple things all going on at the same time....but by last night I had such a fever I could not get warm no matter how many blankets I piled on.

I have slept the clock around - I NEVER do that! Feeling a bit shakey....so I'm laying low for the rest of the day. Maybe by tonight I'll be better enough to get back on the PHP - after cheating on it the whole weekend!

I'm not ignoring anyone....I'm zonked out on the sofa....

2 comments

PHP - Day 32 - May 9 - Part Two Posted 6 days ago
digg
delicious
stumble
reddit

Ok now - trying again. Doing each thing separately. Also discovered I had the variable $color to pick up the value of $year - another careless mistake. Changed that.

Went back and made the year validation do just the first part - make sure it was numeric and 4 digits. That worked.

So then, I did, as a separate thing, not nested, a validation of the year to make sure it was before 2008, and with the cute quip about coming from the future.
And that worked!

So why did they not work when nested? Obviously because I did something wrong in the nesting part. Trying it again.
Put in the very first line:
as so: if ( is_numeric ($year) AND strlen ($year) == 4){

This time I left the ending curly brace and just moved it down the page so It would be there.

Then added back in the second part:
as so: if ( is_numeric ($year) AND strlen ($year) == 4){

        if ($year >= 2008) {
print "<p>Either you entered your birth year wrong or


you've come from the future!</p>";
} else {
$birthYear = $year;
}
else {
print ' Please enter the year you were born as a four digit number! ';
}

}

Ok….so far so good. Now I need another “else” for the end of the very first conditional. Putting it right after the last curly brace under $year.

Saved it -
and - blank page. What am I missing here?

Ok…for now - I’m just not going to nest things.
Obviously I’m missing something, but I have no clue what - and the book is no help - it is assuming that the code as written works - but not for me.

Revised my page as so:
//validating the year things
if ( is_numeric ($year) AND strlen ($year) == 4){
$birthYear = $year;
}else {

print '<p>Please enter the year you were born as a four
digit number!</p>';
}

and then:
// trying the second part separate - birth year before 2008
if ($year >= 2008) {
print "<p>Either you entered your birth year wrong or you've come
from the future!</p>";
}

And this works! It’s a mystery to me - but at this point, it’s just easier to do things separately than to nest them - for me!

And that’s my second 15 for today!
Check it out - and try not picking a color and see what it says….a bit of fun for me after this frustrating day!

www.shimmershine.net/register.php

0 comments

1 2 3 ... 23