So I know it's quite a long title but I'm not sure what I'll be searching next time. It has taken me a lot longer than I thought it would mostly out of frustration and the inability to know exactly what I'm looking for... always difficult. After a cup of tea the solution was glaringly obvious, just do a primary school mathematics table and it all makes sense (see my 10 mod table below).

This article is a quick note (so I never spend as long again) in PHP on how to determine when looping through a loop, which entry was first and which was last. This is incredibly useful for pagination.

If you're not an IT person, you may want to avoid reading the rest of this article in case you're easily offended. It's just an amusing stab at customers computer issues. Note that most of the below were remote support jobs so we weren't there in person and could only see the users screen.

Three Webdevelopers phone in to say their computers can't view a website properly

"Can someone have a look at our computers because we recently received the new corporate template for our website and it's not displaying properly on my colleague's computers". [Priority 1]

What's a web guru?
Well this might be obvious to some but these are self-proclaimed highly qualified web-gurus in the marketing department. They'd paid around £150,000 for a template designed by a 3rd-party company. Received the zip and uploaded it to their homepage. The 3rd-party company had obviously designed the template to work in one browser only: Internet Explorer version 7. The marketing web-gurus were simply using different browsers. The project leader was on IE7, while their designer was on an Apple Mac using Safari, and a third was using Mozilla Firefox. We told them to go back to the template providers and report the same problem to them...???

Staff member requiring access to a secure application

"So that's all installed for you. I just need you to restart your computer now and tell me when that's done.".

"I've done what you said but it's still not working".

"From my logs, you haven't restarted this machine in a while.".

"No I definitely log off every evening and then back on again".

"You mean you log back on in the morning?"

"No it takes so long in the morning, this is quicker".

Explained how logoff is not the same thing as restart and reminded on both IT and environmental policies. Tech Notes: For PCs: Run a command prompt and type systeminfo: Look for "System Up Time".

A staff member in a partner institution:

"By the way my printer has stopped working, in fact it hasn't been working for ages, could you also look at that".

"Is there a power light on when you switch it on?".

"Yes it's definitely plugged in if that's what you're asking.".

"Is it a networked printer, I mean is there a cable that directly connects the printer to your computer or does the printer plug into the wall? Ok could you please follow the cable from the computer to the printer and tell me.".

"Hang on its on the other side of the room.".

This was a remote support job over the phone. The discussion above was after installing drivers and setting up the workstation with updates etc. as per our standard image. The printer was connected via three usb extension cables. The middle one wasn't connected to anything on either end.

What not to say to IT

"Hi could you find <staff_name> and tell them to unlock the record they are viewing".

"Oh that person isn't at work today".

"Well someone on that computer has locked a database record.".

"Well my colleague who's using that computer is in a meeting but I can login and do this for you".

IT Policy: Do not share passwords. It defeats the whole purpose!

A media student:

"My computer has swallowed my CD-Rom, I put in the disk but when I eject the CD there's nothing in there!".

I can't really have a go at customers as it took 4 IT technicians deliberating over 30 minutes (remote support so we weren't there in person): The computer had two CD-Roms. The user put the disc in one of the drives but was pressing eject on the second drive.

Like these? Share your experiences as comments below :)

Spent enough time trying different methods across the web but only 1 article worked for me using the "push" div layer. Loosely based on Ryanfait: Make a Footer Stick to the Bottom of the Page




<div id="container">
     <div id="header"></div>
     <div id="content">
          <div id="left"></div>
          <div id="right"></div>
          <div class="push"></div>
     <div id="footer"></div>
  1.  <div id="container"> 
  2.       <div id="header"></div> 
  3.       <div id="content"> 
  4.            <div id="left"></div> 
  5.            <div id="right"></div> 
  6.            <div class="push"></div> 
  7.       </div> 
  8.       <div id="footer"></div> 
  9.  </div> 
The header displayed fine. The left and right columns finally got them side by side. But the footer that has a background image was under the left and right columns... The main content layer was overlapping the footer. I tried various z-index's bearing in mind that the footer has to be behind because the main content had a semi-transparent layer that overlapped it half-way.

I managed to fix this by including a div push layer which clears both (even though i had clear:both on the css for my #right div layer). For some reason, it has a more forceful effect in its own separate layer.

Category: Cascading Stylesheets :: Article: 350

Add horizontal space between label and fieldset
fieldset label.inline { display: inline-block; margin-left: 2em; }
  1.  fieldset label.inline { display: inline-block; margin-left: 2em} 

Change color of fieldset grouping line
fieldset { border: 2px ridge #7abcff; }
  1.  fieldset { border: 2px ridge #7abcff; } 
Category: Cascading Stylesheets :: Article: 349

Quick note in case I spend as long as I did again.

A Client had some clouds on the background of his photoshop file for his website. They were to be positioned in the top right corner with the leftmost tip aligned to the right of a central content section. I separated off the clouds as another div layer, specified the width and height and specified it's left. It caused the horizontal scrollbar which is a bit annoying because you scroll to the right and theres nothing but some background image. Also the footer was at 100% so it got cut off if you scrolled horizontally.

Aim / Objective
To have a background of sky and grass with a centered content section (white semi-transparent layer) of 900 pixels width as shown in the following picture:
background of sky and grass with a centered content section (no clouds)

And I want the clouds as another layer ontop aligned to the top right:
background of sky and grass with a centered content section (with clouds)

To be honest I saw this on some Joomlaworks Blog who appropriately title it "A must see for professional webdesigners". If you're a developer relying on clients for your income, then at least watch some of this.

March 2011 San Francisco, CreativeMornings ( was Mike Monteiro, Design Director, and co-founder of Mule Design Studio ( This event took place on March 25, 2011 and was sponsored by Happy Cog and Typekit (who also hosted the event at their office in the Mission).

2011/03 Mike Monteiro | F*ck You. Pay Me. from SanFrancisco/CreativeMornings on Vimeo.

I might already have something similar to this but this deserves its own article. Why? Well try to search the web for a PHP/MySQL solution which suggests on how to count the hours between two times on the same date, when one of the hours is on the other side of the midnight hour...

Now bear in mind the below is in European date format

Consider the following:
Date       Customer        Time From       Time To          Hours
---------- --------------- --------------- ---------------- --------------
04/03/2011 Tweedle Dee     10:00           12:00            2.00
08/03/2011 Tweedle Dum     23:30           00:30            -23.00
  1.  Date       Customer        Time From       Time To          Hours 
  2.  ---------- --------------- --------------- ---------------- -------------- 
  3.  04/03/2011 Tweedle Dee     10:00           12:00            2.00 
  4.  08/03/2011 Tweedle Dum     23:30           00:30            -23.00 
Note the last row is obviously incorrect. This is because the script is not changing the date at the stroke of midnight. Take the last row as an example, the equation that's happening is:
$thisDateSQL=date("Y-m-d", strtotime($sub_row['DateSession']));

$this_time_from1 = date("H:i", strtotime($sub_row['TimeFromSession']));
$this_time_to1 = date("H:i", strtotime($sub_row['TimeToSession']));

$this_time_from_sql=$thisDateSQL." ".$this_time_from1.":00";
$this_time_to_sql=$thisDateSQL." ".$this_time_to1.":00";

$sum_hours = number_format(((strtotime($this_time_from_sql)-strtotime($this_time_from_sql))/60)/60, 2);

// Using the examples above this is doing the following:
2011-03-04 12:00:00 - 2011-03-04 10:00:00 = 2.00
2011-03-08 00:30:00 - 2011-03-08 23:30:00 = -23.00
  1.  $thisDateSQL=date("Y-m-d", strtotime($sub_row['DateSession']))
  3.  $this_time_from1 = date("H:i", strtotime($sub_row['TimeFromSession']))
  4.  $this_time_to1 = date("H:i", strtotime($sub_row['TimeToSession']))
  6.  $this_time_from_sql=$thisDateSQL." ".$this_time_from1.":00"
  7.  $this_time_to_sql=$thisDateSQL." ".$this_time_to1.":00"
  9.  $sum_hours = number_format(((strtotime($this_time_from_sql)-strtotime($this_time_from_sql))/60)/60, 2)
  11.  // Using the examples above this is doing the following: 
  12.  2011-03-04 12:00:00 - 2011-03-04 10:00:00 = 2.00 
  13.  2011-03-08 00:30:00 - 2011-03-08 23:30:00 = -23.00 
This is great for everything during that date as long as the "To Date" never goes past midnight into the next day... But what system doesn't do this (no Microsoft jokes please)?
Category: Web-Development :: Article: 339

Credit where Credit is Due:

Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman

Related Articles

Joes Revolver Map

Joes Word Cloud

report   display   form   where   name   date   page   following   parameter   script   source   data   server   database   work   time   find   value   added   files   google   need   table   note   list   version   deluge   order   used   joomla   error   zoho   solution   file   field   uploaded   website   code   system   create   license   could   using   would   function   creator   first   windows   user   mysql   JoelLipman.Com


Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Donate to Joel Lipman via PayPal

Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 bc1qjtp4l4ra452wzvuk9a45yfj82zkahsyy2z379y
© 2023 Joel Lipman .com. All Rights Reserved.