There are plenty of reasons to need to redirect a page.  If you do, you here is a sample PHP code snippet that will allow you to point a page to another page on your site or any other site quickly and easily.

This script needs to be the first lines of the script, before any headers or any characters for that matter are sent to the browser.  This means, make sure there is NO SPACE before your opening “<?php” tag.  This happens more frequently than you think, yes, a single simple lonely ” ” space character will make sure this redirect will never work…


<?php

header(“HTTP/1.1 301 Moved Permanently”);
header(“Location:http://newlocation.com“);
exit;

?>

I know it flies in the face of standard coding conventions, but one day we might create a syntax and structure built into our language where a stray space character or semi-colon won’t violate the structural principles and somehow be auto-corrected.  Of course, one may argue that they want a web developer who can notice such details, on the other hand, wouldn’t it be great if your brilliant web developer didn’t have to spend so much time and energy hunting down stray characters that perhaps less experienced coders inadvertently through into their code?  I guess this is one of the best arguments for using a PHP framework since the constructs are tighter so it would be more difficult for developers in a collaborative environment to be taxed with the burden that comes from having too open of a development environment.

Then again, it seems like frameworks such as Symfony and Cake often create more work for simple projects than if your web development team stuck to some standards and developed new content using OOP and MVC patterns.  Using OOP and MVC combined can create an excellent and reliable pseudo-framework but still give your web development team enough flexibility to push new scripts out quickly.


First off, that your company was wise enough to stay with open-source and go PHP is a compliment to you and your leaders’ foresight.  You have that going for you, at least!  If your company is looking for an open-source web developer, chances are you need someone who knows PHP, MySQL, HTML, CSS and Javascript/JQuery.  At a minimum.  If you are the “techiest” tech person from your company who was tasked to find someone “because we need to bring web development in house”, but you don’t know where to start, then this articles is for you.

Do you need some impartial advice?

If you are very technically proficient in PHP, perhaps you don’t need any advice.  You know what you’re looking for, but it’s always smart to seek others’ opinions.  After all, how’s the rest of the world doing things?  Knowing this will help you understand what kind of candidates are out there, but not only that, you are protecting your company in the future because you don’t want to build your information systems, websites, internal and external software and get cornered because you didn’t leverage the “open” in “open source”.  You would be beholden like some companies that were Johnny-come-latelies the last wave of a programming language and still have COBOL programmers on staff.

It is your duty to future proof your code and web assets

About 8 years ago, the PHP community figured it was time to grow up so the movement towards “object oriented programming” (OOP) started in earnest.  I can tell you that if you write PHP scripts so everything belongs in one .php file, you are not qualified to think you know as much as you do about PHP to interview and hire a PHP developer.  If you think including a few “include” files is a great way to organize your code, you blinked and 10 years have passed.  Seriously.  Go to this primer to get off the “Spaghetti Code Diet”:  http://codebetter.com/raymondlewallen/2005/07/19/4-major-principles-of-object-oriented-programming/

If the web’s important, a team development environment is key to your future

First off, if a developer leaves your company, you don’t have to worry, everyone on your team is involved with each project because they can be if you design your development environment around MVC and OOP.  If you plan on being bigger and relying more on your information systems and websites, you best modularize your code.  This way, your team can divvy up projects and work together without overwriting code.  Many benefits and compounding savings from reusing code more efficiently along with designing your code around a collaborative environment will save you a lot in time and will benefit you in a compounding level of quality code production.  Think of the “smart grid” but in terms of your websites.  If you are a big enough company with multiple developers, OOP and MVC is the only approach that makes sense.  Not to mention your need for a code versioning repository like Git Hub or an SVN server solution from Collabnet or the likes.  It’s imperative you foster a team environment where your developers can collaborate and not stumble over themselves in frustrating futility.  It’s like asking them to write code in a pool of water, it just doesn’t make sense.

With the right environment, multiple developers can work on the same project, and since it’s all modularized by design, one can work on the front-end form, the other the data handler all without colliding with each other.  “Here’s the class with the parameters, I provided a sample of the methods,” one developer can say to the other and take what the other developer wrote and inject it into where they needed to utilize their object just like plug and play.  It really is “plug and play” code.  This is what you need and your company should want.  But what happens if you’ve read up to this point and all you have are more questions?!  Contact me, I’m not cheap, but my advice could save you millions and help make you even more.

It is your duty to future-proof your company, even if you don’t know how

If it is your job to hire a web developer, it is your duty to find someone who will future-proof your software and web assets.  Procedural code has it’s place, nestled neatly within a method of a class.  If what I just said is foreign to you, start Googling “MVC” and “OOP” related to PHP for your own sake and stop and get some serious advice.  First of all, who is making the decisions that you need a web developer in house?  Someone who heard from someone else told you it was a good idea?  It’s a pretty safe bet that if the owner or GM of the company is telling you to look for a full time web developer, then there’s a budget set aside for his or her’s salary.  I often wonder how a company winging it often got as far as it did and still managed to at least stay open source and no go the Microsoft route.  Perhaps Microsoft’s licensing for .NET applications and servers serves a higher purpose.  In case you can’t tell, I’m an open-source guy through and through.  Give me a LAMP running the newest version of PHP and I can bring all kinds of information and tools onto the screen.  Using PHP correctly is an art, but when designed and executed properly, it will stand the test of time.

We will be discussing OOP and MVC much more in other articles.  It’s just so important that even if you don’t understand the technical issues, it’s the difference between building a house over wet sand or building a house on a solid foundation.  One way is going to cause you so many more headaches later.  It is that critical and doing your homework by finding the most suitable, future-proof web developer now will save you thousands of hours, the need to hire more developers to maintain poorly designed code, and the immeasurable savings you will never actually see in time and problems saved by your web visitors and internal users of your websites, databases, and internal software systems.

Top 10 Challenges to Test Your Future Web Developer

These questions get to the heart of the matter and will help guide you in picking a web developer you won’t have to worry about learning on the job and can hit the ground running.  By the way, these questions are focused on the big 5 PHP, MySQL, HTML, CSS and Javascript/JQuery because you need someone who understands not only how code works, they can show that they understand how to show the code!

  1. What is the difference between an abstract class and an interface?
    • This tells me if the PHP developer has at least a moderate level of experience with object oriented programming
  2. Design two database tables, one that holds basic user profile data and another that logs their activity of every page they visit on a particular website
  3. Using the database you designed above, write a MySQL query that will create a report of the top 5 most popular pages visited.
  4. What type of code repository do you use and why is using one important?
  5. Write a sub-routine that will place two rows of 4 boxes, each 200 pixels wide on screen.
  6. Make the boxes responsive so tablet they will be 4 rows of 2, and smart phone 8 rows each with one box.
  7. Write a JQuery loop that will resize all boxes to be 350 pixels height
  8. Design the file structure and breakdown, in MVC, of a contact form that will pre-validate with bootstrap, but post-validate with a separate handler.
  9. Design the contact form in your favorite IDE, complete with fields, field names, and design.  Be sure the form page is responsive.
  10. Customize the contact form with your favorite bootstrap or other CSS library and customize the buttons and header of the page to match our current website theme.

Other questions, depending on the type of business you run (e-commerce or more data-driven):

When instancing a class from an external file, what are some things that can happen that will throw a 500 server error?

When is it a good opportunity to use session variables?

When should you avoid using AJAX calls and instead load a new page?

Write a couple of .htaccess rules that will redirect a user from:  request.php?id=3 to /request/3/

How do you call a WordPress shortcode from an external php template?

In Magento, what is a child theme and how do you create one?

These are just general questions, maybe you have your own you’d like to share?  Please do!

 

 

 

 

 


If you do not recall being able to place newspaper ads, radio ads, AND national television ads through the Google Ad Words platform, much less never even knew you could do these things before Google slowly abandoned these incredible auction-based advertising platforms, please do your own research before coming to a different conclusion than the informed analysis I offer below.  If you disagree or agree with this article, I would love to hear from you!

Google: king of Kwality serches

A word of caution for all you “Google Only” homers out there.  Though Google “owns” over 65% of all website searches, the combination of Yahoo and Bing is over 30% and Bing is trending upwards, slowly gaining share in the competitive search engine market.

Loyalty to one search engine by the elitist web marketing experts have actually been making a mess of useful consumer data and trends for quite some time.  One could argue that if 80% of all searches are made by 20% of the people (just an example), and a majority of those people are not actually consumers looking for what they are searching for but looking for information behind those searches, 80% of that information about searches many companies make high dollar decisions on is polluted and unusable from any statistical sense unless, of course, you are doing research on “how the blind lead the blind when it comes to web marketing.”  This means, pay attention Marketing VPs, that your assumptions about Google being the only search engine you should focus your marketing dollars and resources on are probably wrong.

A 10+ year web marketing perspective

That’s right, 10+ years in web marketing.  Please remember that my 20+ years in marketing (yes, marketing existed before the web where I worked as a graphic designer at 3 different newspapers in the ’90s) and advertising experience was lent to offer this article, this is not some off-hand commentary from someone — I have been involved in web marketing since its infancy.  I was hired to do marketing research and analytics as part of an ad agency in some form of services rendered since 2001.  Since then, I have placed thousands of ads in different forms and platforms and millions of dollars of ads through Google Adwords, Yahoo, Bing, local and nation TV including DirectTV, Dish, Comcast, and SpotRunner for a variety of clients over these past 10 years.  I actually was a producer of a few TV shows that had videos running on websites since late 1997 — that’s 17 years ago.  Gosh, I am old!  🙂

Quality searches compress the comparison results between search engines

There are a few schools of thought that Google vs Bing & Yahoo are actually a lot closer in overall useful and relevant searches than the raw numbers tell us.  I’ve seen this in the Midwest managing e-commerce sites.  So many webmasters, SEO experts, and web marketers tend to flood Google with useless searches by the droves — going to page 25 of search results and experimenting vigorously with every iteration of a possible search term, trolling search listings that could produce marketing leads.

This is not widely understood across the industry that because everyone knows Google is the best search engine lends itself to a self-fulfilling prophecy lead none other by the very “experts” that are diminishing Google’s very own usefulness and subsequent usefulness to them by drowning it in its own success and skewing the results and facts about quantifiable searches.  After all, like the 20% example above, if one person averages going to 10 pages in depth and tends to type 5 times more small variants of the same keyword search terms for research purposes, one may argue that Bing and Yahoo combined actually deliver more quality searches because people on those sites are more likely looking for what they need as regular consumers and not marketers in sheep’s clothes.

In actuality, Bing & Yahoo, which formed an advertising alliance in 2011 called “Ad Center” accounted for 39% of all search results to the e-commerce website I set up, managed, and helped grow at www.RiddlesJewelry.com.  Part of the reason is their strong Midwest presence, which, aside from Montana, skews PC users who inevitably have the “Bing Desktop” installed on millions of computers.  Not much has been written about this phenomenon, but any marketing person who understands statistics should be very weary of accepting that Google is the only search engine they should be concerned with.  This is naive and a bit presumptuous — a few companies have doubled web sales in less than 3 months after moving their SEM strategy from an over reliance of Google and its ads to understanding Google is king but balance is a necessity to capture the most quality leads possible.

At the very least, any budgets where a business is placing ads for a campaign should have 30% of its Google budget devoted to Bing/Yahoo’s AdCenter.  You may also enjoy the keyword research tool in AdCenter, which extends Bing’s basic keywords research tool a bit more.  I hope you find this different take/perspective useful when allocating your marketing dollars, time and resources or the very least gave a chuckle to the Google Only homers out there.

– Aaron Belchamber