This tutorial starts fresh with Object Oriented programing with a focus on implementing an interface, and using that interface for our advantage when going through an array.
This tutorial covers
Creating classes
Creating an interface
Implementing an interface
Using a magic constant
Here’s the video,
Make sure to take the jump if you want to see the final source code! Read more…
This tutorial starts fresh with Object Oriented programing with a focus on extending other classes, and a parent class that holds collections of the account class.
It covers
Class creation
Class Extension
Peak into the static keyword
Example of instanceof
Small explanation of the self keyword
Here’s the video, I’m totally winging it without any prior planning other than to cover something more that I did not cover in the last tutorial. Thanks to you subscribers now, I don’t have to split up my tutorials!
Make sure to take the jump if you want to see the resulting source code and textual explanations. Read more…
This is a basic introduction to Object Oriented programming in PHP.
Here, I introduce
classes
public/private variables and methods
magic methods
method chaining
I use a diagram to show the concept visually before creating the code, and then I test it in the terminal.
I also show variable casting to ensure that information is properly handled, even when it is of the wrong type.
One of my tutorial followers graciously emailed me with an interesting problem, when they tried to use my blog tutorial(#13), when they put in asian characters, they went into the database wrong. AND if directly put into the database, it would echo out as ????
This can be a very annoying problem, one that I found the solution to.
So, in my example in connect.php(where the database connection is established) after the line that has the mysql_selectdb in it the following has to go after that, but before the ?>
mysql_query(“SET character_set_results=utf8″);
mysql_query(“SET character_set_client=utf8″);
mysql_query(“SET character_set_connection=utf8″);
mb_language(‘uni’);
mb_internal_encoding(‘UTF-8′);
Next, the forms that submit data have to be modified to accommodate the character set(for some reason PHP or the browser gets it wrong and it turns into a mess.
If you set the attribute in the <form> tag
accept-charset=”UTF-8″
It should send to the server correctly.
SO… like <form accept-charset=”UTF-8″ action=”blah.php” method=”post”>…..</form>
Also, to make sure it displays correctly on the page, wrap it with iconv( ‘UTF-8′, ‘UTF-8′,$row['title']); or mb_convert_encoding($row['title'], ‘UTF-8′ );
However, I noticed it doesn’t like htmlentities wrapped around it or anything like utf8_encode, or what ever. So be sure to test!
This tutorial goes over implementing editing, and modifying the posting page to use a really cool in-page content editor, CKEditor!
So, here are the goals for today:
Implement the Fancy Editor into posting
Create a way to edit based on the posting
Now, it doesn’t sound like that is much to do, but as I explain it in depth, you will understand that there is more process to such implementation than what two bullet points can convey.
So, here is the recording(total ~ 25 minutes), there are two parts so please make sure you click on Read More to see the download-able sources along with part 2.
This tutorial in essence goes over implementing posting and inserting data into a database, along with data validation for the blog. This one also extends on Tutorial 10, 11, 12, so please check those out if you have not.
Here’s the plan:
Make a page for posting
Make a form
Get the SQL for inserting
Prepare and validate data
Test page functionality
Finalize and clean up
Part 1:
Make sure to click on Read More so that you may see Part 2 and the sources. Read more…
This tutorial goes over implementing a log in system into the basic blog from tutorial 10/11. The goal is to use a session, a form, and a few pages to log in, log out, and of course, setting up future tools for the blog administration that will be shown in future tutorials.
You may refer to Tutorial 8(Login Concept) as we go though this tutorial.
Part 1:
Make sure to click on Read more so that you may see Part 2 and the sources(including downloads)! Read more…
This tutorial goes over an inner join SQL query and extending the basic blog from tutorial 10 to have a link to a single-post page.
First of all, I am basing this tutorial on the last tutorial(10), which established a basic blog. Here we are going to compound the original statement that looks like SELECT * FROM posts ORDER BY date DESC
What we are trying to do however, is to remove the statement that looks like "SELECT postname FROM users WHERE ID = ”.$row['username']
and preserve the information on “Who posted it.”
The Second objective of this tutorial is to simply make the titles of the blog posts linked to a page that shows that post exclusively.
Here is Part 1 out of three, please watch all in their entirety so that you may understand them to the fullest.
Part 1:
Click on Read More to view the sources along with Part 2 and 3 of the video Read more…
Here’s a start for beginner web programmers: a Blog which will evolve into not only A blog, but a content management system. Alas, we need a beginning. This tutorial first starts with setting up our blog system. This blog system is designed in a way that can be expanded for future tutorials for real application.
Here’s the first video, Part 1:
Please click read more to see the sources, and part 2 and 3. Read more…
I wasn’t dead, nor have I given up on these tutorials. You know what gets in the way of our goals, Life. I turned legal age, I graduated from High School, and I moved, all within the same period of time. I’m still dealing with the moving part, but I now have a summer of time to make tutorials for PHP while I study Regular Expressions and Java.
So, here comes the good news:
I have many open days in which I should have time to release maybe even 2 tutorials a day. The problem: I need ideas. I have a couple ideas, but I’m pretty sure I’ll run out quickly.
I have so far ventured into where it comes to creating solutions and not as much into use of certain defined functions anymore. Sort of hard to use only one major function in something I guess!
Which also comes where I am thinking of redoing some of my first tutorials over again(now that I have better experience with the whole process), even if I don’t get any replies, I’ll still redo them. I want a good full series. Read more…