Make a Div Into a Link

It’s easy to make any div into a link by using a bit of javascript. You can use this technique to make any div “clickable”. For example, you might want your “header” div to link to your home page. Here’s how it’s done. <div onclick=”location.href=’http://www.example.com’;” style=”cursor:pointer;”></div> you can make your header div clickable by using […]

Read More

Switch Case

Example #1 switch structure <?php if ($i == 0) { echo “i equals 0”; } elseif ($i == 1) { echo “i equals 1”; } elseif ($i == 2) { echo “i equals 2”; } switch ( $i) { case 0: echo “i equals 0”; break; case 1: echo “i equals 1”; break; case 2: echo “i equals 2”; break; } ?> Example #2 switch structure allows usage of strings <?php switch ($i) { case “apple”: echo “i is apple”; […]

Read More