Archive for the ‘PHP’ Category

Rotate a Banner Image with perl and PHP

information logo Rotate a Banner Image with perl and PHPSo, the other day I needed to do three things.

First, I needed to have a banner image that changed each day.  This image would reflect a daily deal or promotion for a company.  Second I needed the link associated with the image to change and be specific to the promotion and deal.  And to spice things up, I also needed this to be used by other people with sites that could be anything.  So of course I broke the problem into two pieces; Image Rotation, and Link Rotation.

(more…)

Thursday, October 6th, 2011

Rotate a banner and Link with PHP

math 150x150 Rotate a banner and Link with PHPNot writing about scope creep today, but this project started out simple.  We want some code that we can use to rotate a banner and link to it with a url that rotates with the banner in this manner.  ”Tuesday, Thursday and Friday will have a specific image and promotion, and all other days will have a general banner and promotion. Can you do this?”

Well of course the answer was yes.  I would need the images, and the destinations, and then it was a simple matter of matching the days of the week to the images and lings.  So I wrote this script:

(more…)

Tuesday, October 4th, 2011

PHP TIP: Comparing values that have Negatives.

I don’t know if this is something that everyone will need.  But I deal with supply chain integration and e-commerce.  And for me, writing code that deals with quantities happens every day.  And I run into negative values quite often.  Today, much of my code is written in PHP.  So ,the first time that I tried to make an condition using these it went like this.
math 150x150 PHP TIP:  Comparing values that have Negatives.
If($qty<$minQty){

[Do something.]

}

And this worked great until the $qty was -1 or less.

Then all of the sudden, I was treating it like it was a positive number.  After a few hours of hair pulling trying to find the flaw in my logic, I discovered that the solution was quite simple.

(more…)

Thursday, May 5th, 2011

What does PHP stand for?

question mark 150x150 What does PHP stand for?Strangely enough this is a common question.  We all throw around PHP, and other sets of initials as if they were their own words.  There is some evidence in the annals of IT that these initials were used for “Personal Home Page,” however this really doesn’t help use the label and define the Hypertext Pre-Processing language used for development.

For me, Pre Hypertext Processing is the meaning of PHP.

(more…)

Wednesday, June 9th, 2010

Powered by WP Robot