LAN Net Work!

LAN Net Work!

LAN Tait is Net Working!

Friends Flags…

Free counters!

Sessions

No Sessions

WebSite 103 - See HTTP Headers Online or with Firefox, Chrome, and Curl

Sooner, rather than later, you will need to view your HTTP Headers.   You can find information like if the site has a 301 or 302 redirect, a 400 or 500 error that does not show, or even if it uses a utf-8 or an iso-8859-1 charset.  Here is how to do it using Firefox, Chrome or Curl.
Continue reading WebSite 103 – HTTP Headers

GitHub, Google Code and a Git GUI on Linux Mint Mate

Recently I was talking with fellow CodoDojo Sensei, Marie. She is having a problem with the Atahualpa Theme for WordPress. The author / team at Bytes For All have a different idea of what this theme should be than many of the people who post on their website.

Sensei Marie said she would like to take over the stalled TuKod project and focus on the TuKod Theme – a fork of the Atahualpa Theme. I told her to set up a ToKod Theme project on GitHub as this would help her. She asked my help and with my brand new Linux Mint Mate computer, I set out to find a Git GUI that would help her…
Continue reading Using GitHub, Google Code and a good Git GUI

WebSite 102 - First Webpage

Now we are going to write our first HTML5 weboage!

Your part is to copy and past this into your Geany text editor. Save the file someplace you will put your work, and call it index.html

You can now double click the file, and open it in Firefox or Chrome. I know it is kind of ugly, but this is just a step in the right direction. Nothing here is chiseled into stone. In fact, we are going to change a lot of this.

Now it is time to do some homework. Google is your friend!

Take each HTML5 tag and Google it! What does <head> do? How about <title>? Where do use <body> and what is it for?

This is very easy, just go to Google and type in:

HTML5 <p> MDN

Change the <p> to any other tag, like <h1> or <title>

Click on the first result from Google, and there you have your homework answer!

Study this page until you understand what the <p> does. Use well formed code (close every tag you open, in reverse order).

Study each tag, there are only 18 tags (plus their close tags). Think of these tags as new words and learn how to define them. Only 18 new words is not a lot to learn. In fact, in ALL of HTML5 there are just over 100 tags, Just think, you know thousands of English words, usually 6,000 – 80,000 so 18 more HTML5 words to define will be easy for you to do!

Tip: If you do not understand something on MDN try googling “HTML5 <p>” for additional ways to explain it.

Now let’s get started!

<!DOCTYPE html>
<html lang="en-US">
<head>
  <meta charset="utf-8" />
  <title>HTML 5 complete</title>
  <!--[if IE]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
  <link rel="stylesheet" src="//normalize-css.googlecode.com/svn/trunk/normalize.css" />
  <link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
  <h1>The most important heading on this page - Page Title?</h1>
  <h2>Important Info - Website Name?</h2>
  <h3>With some supplementary information - Tag Line?</h3>
</header>
<article>
  <header>
    <h1>Title of this article</h1>
    <p>By Richard Clark</p>
    <p>You could have a &lt;footer> or a &lt;header> for a &lt;section> or an a &lt;article>.
  </header>
  <h2>Hello World</h2>
  <p>Hello to everyone!</p>
  <footer>
    Footer information for article.
  </footer>
</article>
<footer>
  <ul>
    <li>copyright</li>
    <li>sitemap</li>
    <li>contact</li>
    <li>to top</li>
  </ul>
</footer>
</body>
</html>

WebSite 101 - HTML5, CSS3, PHP, JavaScript, Database, htaccess and SEO for DIY Coders

Lesson 1

Today I am adding a tutorial category I will call “WebSite 101.”  In WebSite 101 I will teach you how to build a WebSite, from the ground up.  This is really a Do-It-Yourself  (DIY) course that will take you from the very beginning (basic HTML).  Step by step we will build a dynamic, database driven WebSite that covers things like, HTML, CSS, PHP, JavaScript, Database, htaccess, and SEO.  Even if you do not know what any of those mean, you can follow this.
Continue reading WebSite 101

Common MySQL fields and their appropriate data types - Cheat Sheet

I am working on a new database class, and CRUD class, and login class that I plan to make the core of a number of new, dynamic, database driven websites. You see, all database driven websites have a number of things in common. For example some kind of user_name and password.

One thing I have found in my life is that I go back to the MySQL manual, again and again, to look up appropriate data types for my field names. For example, should a field for a users URL, or email address, be using a VARCHAR or TEXT MySQL Data Type and why?

For years I have taught my students Three Rules about MySQL Data Types and Field names. Students who follow these simple ruled hav much less problems designing and using Database Data Types (which next to selecting a field name, is the hardest thing about designing and using a database!).

I have now made a Cheat Sheet that makes all of this very simple!
Continue reading Common MySQL fields and their appropriate MySQL data type – Cheat Sheet

Security by Obscurity vs. the Obscurity Security Layer

I have on my desk about a dozen website projects to develop. Amazingly, they have a few things in common such as:

  • Dynamic user written.
  • Database driven.
  • Member and Admin Login.
  • Security Concerns.

Ever since Sony had their servers cracked open by what the press seems to report was the North Koreans, people have become a lot more aware of Security!  Security by Obscurity (or Security through Obscurity, or Security via Obscurity) has proven to be very little security at all.  This is because if the Obscurity is ever discovered (and usually can be discovered in a number of ways), the security becomes “totally compromised.” But does it really?  Well, yes and no! You may want to strengthen your security, by using the Obscurity Security Layer!

Continue reading Security by Obscurity vs the Obscurity Security Layer

Mint Mate 17 - Sharing 2nd Hard Drive

As I already reported, I am Leaving Ubuntu for Mint Mate 17. You may want to read that post before this one.

The only problem I had when I loaded Mint Mate was that my boot drive was 500gb and I added a second drive of 1TB to store movies on. But when I tried to share folders the same as I did with the boot drive, From the Client computer I could see them, but I could not open them, and I got this error…

Error: Unable to mount location – Failed to mount Windows share.

This Document explains how I solved this error.
Continue reading Mint Mate 17 – Sharing 2nd Hard Drive

Leaving Ubuntu for Mint Mate 17

My partner has a young daughter who likes to watch movies like Tinker Bell and Barbie’s Dream House. The problem is that she is a work at home mom and plays these movies on her computer. She is a work at home mom and uses this same computer for her work. Obviously the needs of one conflict with the needs of the other. She cannot work and play movies for her daughter at the same time!

The Old Computer

Earlier this year I bought a new computer, and kept my old computer to make into a development server. It only has 2 gig of ram and a Atom 2 core processor, plus a gigabit Ethernet controller. For a “house server” to serve I figured that was enough. Mostly just to serve movies to the 2 computers on our network. A few weeks ago I retired my 24′ screen for a 28 inch. Since then my partner has been eying the unused computer for her daughter to play movies on. So I decided to make a “mouse only” computer for playing movies, a samba server to serve the same movies to the other computers on the network, and to add SSH to build a LAMP (or LNMP) server in the background, later on.
Continue reading Leaving Ubuntu for Mint Mate 17

UTF-8 Character Encodings in HTML and CSS via htaccess - Easy!

Years ago I fell in love with UTF-8.  More recently I have developed a love for HTML5 and CSS3.  I have found that as I am teaching these, my students have been confused about how to set Character Encodings (and Content-Language).  So I decided to make an easy to follow tutorial on how to set both of these in your htaccess file.

Continue reading UTF-8 Character Encodings in HTML and CSS via htaccess – Easy!

PHP Tutor #4 - Fixing a String Case, trim, ucwords, strtolower

In this tutorial we will explore manipulating the case of a string, and how to clean up strings like names. in PHP Tutor #4 we learned how to put a literal string into a variable like this:

<?php
  $name = 'marie estebanie pelin';
?>

However, the problem with this is, it is all lower case! And what if the person entering it had added a space at the front or end of the string? That could mess up alphabetizing a list! Or what if we wanted to extract the initials, or what if we wanted just the first two letters of each name to make some kind of username? Let’s look at how we can manipulate the case as well as extract a few things from a Crazy Bird string. Assume someone entered the following. Notice the extra space at the ends!

<?php
  $crazy_bird_name = ' mArIe eStEbANIe pELIN ';
?>

Trim White Spaces

You can trim white spaces (or any character) from the left, right or both ends of a string!

Let’s use trim or rtrim to get rid of the white spaces at the right.

<?php
 $crazy_bird_name = ' mArIe eStEbANIe pELIN ';
 $crazy_bird_name = trim($crazy_bird_name);
// now it's = 'mArIe eStEbANIe pELIN'
?>

So now there is no space!

More Ideas:

  • ltrim() – Strip whitespace (or other characters) from the beginning of a string
  • rtrim() – Strip whitespace (or other characters) from the end of a string
  • str_replace() – Replace all occurrences of the search string with the replacement string

 

Start a Word with a Capitol Letter

<?php   $crazy_bird_name = ' mArIe eStEbANIe pELIN ';
  $crazy_bird_name = trim($crazy_bird_name);
// now it's = 'mArIe eStEbANIe pELIN'
  $crazy_bird_name = ucwords($crazy_bird_name); 
// now it's = 'MArIe EStEbANIe PELIN'
?>

Two Lines Only

This could have been written with only two lines of code by combining the last two lines like this:

<?php
  $crazy_bird_name = ' mArIe eStEbANIe pELIN ';
  $crazy_bird_name = ucwords( trim( $crazy_bird_name ) ); 
// now it's = 'MArIe EStEbANIe PELIN'
?> 

 

More Ideas:

Not Quite Right!

The above did make each word start with a uppercase letter, but it did not make them look like we wanted, human names! What we really wanted was for the first letter of each word to be uppercase and the rest of each word to be lowercase. So here is how we can do that…

<?php
 $crazy_bird_name = ' mArIe eStEbANIe pELIN ';
 $crazy_bird_name = trim($crazy_bird_name);
// now it's = 'mArIe eStEbANIe pELIN'
$crazy_bird_name = strtolower($crazy_bird_name);
// now it's = 'marie estebanie pelin'
$crazy_bird_name = ucwords($crazy_bird_name);
// now it's = 'Marie Estebanie Pelin'
?> 

We can also write this shorter like this…

<?php
 $crazy_bird_name = ' mArIe eStEbANIe pELIN ';
 $crazy_bird_name = ucwords( strtolower( trim( $crazy_bird_name ) ) );

// now it's = 'Marie Estebanie Pelin'
?>