Saturday, September 26, 2009

PHP & MySQL: Day 1

Introduction



For my first installment of this series, I would like to start by going over exactly what PHP is and how it operates. Most of the time you need to have a firm understanding of how something works before you jump in and start tearing out insides, right? Okay, maybe not, but I'm a careful person. I like knowing what exactly it is I'm getting into. This 'episode' of the series will go through what PHP is and how it works in coalition with a MySQL server. I'm not a very artsy fartsy type, but if you happen to be a visual learner and request graphics to me I'll do my best to photoshop some decent references.

PHP: What is it?



The 'PHP' acronym originally stood for Personal Home Pages. However, somewhere along the course of time the meaning was changed to mean PHP Hypertext Processor. Its redundant, I know. I jest, but PHP is not a language to be poked at frequently with fun. PHP is a powerful language that creates interactive web applications instead of boring, static HTML pages that can only display information. The code runs on your web server and is stored in PHP scripts that usually hold a .php file extension tagged to the end. Essentially, the entire purpose of PHP is to make HTML pages more dynamic.

Okay, so how does it work?



The client's web browser (your web browser) requests an HTML page from a web server somewhere on the 'net. Essentially, for the less computer savvy, it is what you're doing whenever you type an address into the address bar. Example: http://www.example.com/example.html. The web server finds and returns the file your browser requested. In this case example.html. Once your browser displays the page, you will more than likely fill out a form of sorts. I'll go more into what exactly forms are later. Once you hit the submit button on the page, a couple of different things go down. First of all, depending on the scenario, the HTML page is sent from the web server to the client. After, the PHP code within the web server alters the HTML code as needed. In my example I'm going to demonstrate, I will have the web server send myself an email with the data you inserted into the form. (More on this later.) Then, a conformation HTML file will also be sent back to the client's browser.

Quick Question: Did you just insinuate that PHP files contain HTML?


Absolutely. PHP Files on the client's side contain no actual PHP code. There may be some exceptions to this, but I haven't run across any as of yet. This all ties in with the important fact that PHP is a server-side language. No clients involved!

Forms



The form tag along with the action element allows you to point your HTML page's submit button to a certain PHP script on your web server. An example would look like: /form action = "example.php" method = "post"/
The action attribute of the form is what causes the PHP script to run on the server when the form is submitted.

Outro



So what did you think? Good? Bad? Meh...? This is a very slow start, I know. I'm taking things in very small increments over a large period of time on purpose. There will be more to come depending on how you guys feel about my writing and coverage of PHP and MySQL. Lemme get some feedback!

Wednesday, September 23, 2009

I Have Not Forgotten

Hey all! I was just writing to let you all know that I haven't forgotten about you! In fact, I have many ideas for the direction I want to take this domain, however, I am currently involved with far to much daycare school work. Once I get some time, I will more than likely blog about some of the ideas I probably won't attempt to start until the beginning of may next year.

I will more than likely have to pester a friend of mine, Ben about many of my ideas and how to go about accomplishing them. If you haven't gone to check out his excellent articles, do so now. I command it. I have not done what I should to promote his site, but its most certainly worth the click.

Friday, July 3, 2009

So I Had This Idea...

I always have trouble when I get my head into code of any sort. Whether it be Java, Python, VB, C#, C++, SQL, etc. etc... I cannot seem to stay motivated. I always code a little bit, then stop. Then weeks later, I'll poke around with some code a little bit more, then stop.

And I also have this other problem, I'm not consistent with my blogging ordeal. I lack things to write about. But then this idea popped into my head...

What if I could kill two birds with one stone by blogging about my progress in my coding?

What do you guys think about said idea? And if I follow through with it, which language would you prefer I blog over? I'm open to suggestions.

<3's.

Wednesday, July 1, 2009

I'm Soz...

I know I haven't posted in a while, which isn't too bad considering I regularly talk to the only person who visits my blog. But umm... Yar. When I find something to write about, I suppose I'll jot it down and remember to make a post about it.

Kthxbai!

Sunday, May 31, 2009

Always Look On the Bright Side of Life

As per Ben's request in his comment contained in the last post, I suppose I'll create this post to spawn a sort of comment madness that I'm almost certain will occur. I often conjur up inpractical questions when I'm bored and will probably spend a lifetime trying to answer them. So I come asking a loaded question, and by loaded, I mean one that cannot be answered by logical means. 

Why are we here?

Now before someone goes off and says: "Because God made us and wants us to spread his word.", I ask you all to turn away from the religious side of things for a number of reasons. (Refer to earlier posts.) I want your logical opinions on the matter. I guess I'll go ahead and post mine. So I'll get the first jab at things ;)

I for one see no current purpose in life what-so-ever. I do; however, believe that we one day may harvest the intellectual capability and technology to somehow discover a purpose behind this hell we live in. This is ofcourse assuming our species lasts long enough to do so. I'm a very open minded person and I'm looking for some good responses to maybe shine some light at the end of the tunnel. ;)

You'll have to excuse the poor writing. It was written on a whim. (Is that a word? Lawl) 

Oh... and I take back the whole "logical reponses only" thing. Reply religiously if you must.
But be waiting for some hardcore backfire. =) 

Monday, May 25, 2009

The Big "No-No"

That's right... the "No-No". My way of saying religious debate!

Now, I know what you all are thinking. "Oh boy... not another rant with you carrying on about stuff people have already made their minds up about." So let me be clear before I begin this post. I am not writing this to try to alter your way of viewing your religion to make it meet the way I view my religion. Believe me, I've dealt with 4 years of the same stuff from nearly everyone in central Georgia, I'm not going to pull that number on you all. However, I am going to try to express through writing to the best of my ability, the way I see things. Also note that I can't include everything, but I'm sure Ben will make for some good argument in his later posts ;)

To start, I think we've formulated a God-like figure to explain how everything came to be. And that's it. I believe that people thought a God up to explain what, at this point in time with current sciences and technologies, is unexplainable. Allow me to delve further into this...

If we look back to the times when human beings were discovering fire, guess what? They had a fire God. Not only did they have a fire God, but they had a nice little story to go along with the God and how he made fire etc. Until, of course, a scientist came along and said: "Hey... you guys realize that its just ." And this was oft the case for things that again, at the time with their technology and limited scientific knowledge, couldn't explain. Like... the moon. And the stars. There were Gods for all of these things. And of course we look at their beliefs now as ridiculous, but at the time, they were just trying to explain the unexplainable. Just like we're doing today.

In-fact, science has oft threatened religion and many religious beliefs of people. Most early scientists were killed at the hands of a church attempting to shelter their believers from the inevitable truth. Its all very sad...

This will be continued. 'Til then, godspeed. Lulz, get it? :kneeslap:

Friday, May 15, 2009

How Do You Spell 'Educatiun'?

So, over the course of my public education career the way I view the 'system', if you will, has changed. :eyetwitch:

I don't even know where to begin on this post (which I'm sure will turn out to be a rant) about just how much our education systems in America suck. So I'm just going to do something along the lines of a Stream of Consciousness paper.

I suppose at the middle school level things are good; however, in my situation, the higher the grade, the more things went downhill. In middle school I was 'that kid' who make 100's across the board on his progress report. I would go home, have a little bit of free time, do homework for a few hourse, and go to bed. Rinse. Lather. Repeat. For 540 school days. The only reason I bring that up is to help convey just how poorly designed our grading system is. Grades are designed to represent how much you understood and aquired in a particular subject. So, knowing this, should I not be able to recall how to compute mechanical advantage from physical science? (Which I made a 100 in). Or even recall the different types of volcanoes from earth science two years later? Well... I can't. Isn't that something? According to the school system, I am supposed to know and understand to this day 100% of the material I learned two years ago. And right now, in 10th grade honors algebra 2, my average is a 90. And I understand algebra 2 ten times more than I did pre-algebra where I made a 96.

I believe that in today's education system, kids are not understanding the material, they're temporarily learning it. They memorize something for a test, then forget it soon after and move on. They make rules for things in math. i.e. if this number is with the x, then move it the opposite way on a graph. And its really sad because it works. Its how I'm going through school right now. I'm in Spanish 2 with an A average, and I couldn't give you a sentence in spanish that a child in kindergarden coulnd't give you. So are the kids to blame? Should it be on their part to understand the material and not learn it? I think not. I think part of it is the education system and the way it is designed, and the other part of it is the teachers.

Many teachers develope these aweful mentalities in which they hold not responsibilty to a classroom of students failing an exam. If you weren't a kid who was or is in the gifted program, let me let you in on the lives of some of these kids. They go home, study, sleep. Most kids go home and study for hours on end for an exam. Believe me I know. I used to be one of them. And when you have a class of these kids have a 66 class average on an exam, do you think its all on them? I think not! Yet most teachers, with their mentalities, claim "they've done their part". That's one way to look at it, ofcourse. But that's incredibly unfair to the kids who have to suffer through 8 hours of this hell a day...

I'm going to continue this more later on. There's not enough time this afternoon to say everything that I want to.