Archive for ‘Web Development’

March 6th, 2012

Create an Apache Sub-Domain

Not long ago, I was looking information on how to create and configure an Apache sub-domain on my test server.  I found a number of websites covering the subject, but even after editing my httpd.conf file to add the domain and sub-domain entries, the sub-domain would not work!?  So I did more digging and testing and what I found was that the various tutorials and explanations all omitted one crucial element to the puzzle, none of them mentioned that you had to also add a subdomain entry to Windows’ host file! I assumed that since the domain already had an entry, Apache & Windows were smart enough to know that a sub-domain would use the same host entry as the domain, I was wrong! Apparently, Apache & Windows are not that smart, actually they appear to be blatantly stupid!

So the first thing you have to do is edit the httpd.conf file to add the required virtual host entries: 1 for the domain & 1 for the sub-domain

<VirtualHost *:80>
    ServerName www.domain.com
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/websites/www.domain.com"
</VirtualHost>
<VirtualHost *:80>
    ServerName subdomain.domain.com
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/websites/www.domain.com/subdomainFolderName"
</VirtualHost>

But even once this is done, you then have to go and make an entry for both your domain and another for your sub-domain in the Windows Host file.  The values below assume a local test server

127.0.0.1    www.domain.com
127.0.0.1    subdomain.domain.com

Once you make both of these changes, restart your Apache server, and everything should work.  It did for me at least!

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
November 5th, 2011

CodeIgniter 1.7 Professional Development – Review

I am done a considerable amount of web development over the years ranging from HTML to MySQL/PHP driven web applications utilizing the power of such things as javascript, AJAX, jQuery and many more…

I finally decided that it was about time for me to get serious and look into a FrameWork to better standardize my work. As such, I purchased a couple books on the matter, one of which was CodeIgniter 1.7 Professional Development by Adam Griffiths (272 pages) and published by PACKT Publishing.

All I can say is in comparison with the ZEND Framework in Action book, this was a real treat! It was easy to read and they started out with the very basics; Installing CodeIgniter!

The book is written in a manner that I found very fluid and the chapters just seems to flow one into the other.

I think this book is a great purchase for any new CodeIgniter developer looking to learn the basic quickly and easily. At +/-300 pages it isn’t too heavy to be intimidating, but does cover a lot of material in a manner you will understand.

I don’t regret this purchase in the least.

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
November 2nd, 2011

ZEND Framework in Action – Review

I will keep this very short and to the point.

I recently purchased a series of books, one of which was:

ZEND Framework in Action by Rob Allen, Nick Lo & Steven Brown, published by Manning with a total of 401 pages.

I can’t quite explain it, but something just doesn’t work. I seem to end up reading 3-4 times the same sections as if I am continually missing some key piece of information to allow me to actually understand and follow?! They cover everything I wanted to learn, but it just doesn’t seem to be complete. It just doesn’t seem to flow like other books I have read.

For instance, I had to go online to find out how to generate the ZEND directory structure, they seem to make a lot of assumption and/or skip over certain basic issues that, in my humble opinion, need to be part of the book to make it complete! I say this as I am also reading another book about CodeIgniter, which makes this one pale in comparison.

Case and point, I have been unable to date, to create a functional version of the helloworld example as explained in chapter 2 of the book! I keep getting errors no matter what I try. This book has ended up being more frustrating than anything else.

I think for a beginner looking to learn from scratch, this book leaves a lot to be desired. I’d keep looking. For an intermediate Zend developer, this book may be more appropriate.

I am still trying to complete the entire book and will post back with a final verdict.

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
September 1st, 2011

SEO Companies – SEO Optimization Service E-mails

If you own a website, you undoubtibly have received beautiful SPAM e-mails from various sources offering you their Search Engine Optimization (SEO) services. Now the following points may be obvious to some, but I thought I’d put them black on white for people who are new to the field, or are simply not aware of a few things in the www.

so you’ve received and e-mail such as (just a few examples)

We offer quality Search Engine Optimization / SEO Services and Internet Marketing Solutions. Our dedicated team of SEO Professionals ensures Top 10 search engine rankings. Our SEO Processes are designed in view of the SEO guidelines, and white hat SEO techniques are strictly followed to ensure that our clients from world over get the best SEO services. Please reply to this email so we can send you more details.

We will optimize your site to increase its rankings with major search engines. This will drive targeted online users to your site, as well as attract new users through the use of relevant keywords and phrases. Not only will we help you gain those higher rankings, but maintain your status through continual management and support. Please reply to this email so we can send you more details.

We noticed that you are not at the top of the search engines for a number of your key terms. We have helped companies similar to yours to achieve top organic rankings. Please reply to this message and we will prepare a special proposal for you, to show you how we can achieve similar results for you.

We are interested to increase traffic to your website, please get back to us in order to discuss the possibility in further detail.

We strongly believe that we have an excellent opportunity to increase the number of visitors to your website through our white-hat SEO services. Please simply reply to this message and we will be delighted to send you further information.

Search Engine Marketing will increase your company’s online presence through comprehensive online marketing campaigns, targeted search engine optimization, and highly managed internet marketing promotions. A search engine marketing campaign will encompass several procedures and factors to make it successful. Please reply to this email so we can send you more details.

We are a leading India based SEO company providing the best search engine optimization services. We act as your business partner and helps you reach your business goals. We promote websites no matter who you are – a huge company with thousands of employees, a small business or a professional who offers professional / consulting services. Let us know if you are interested and we will get back to you with more details.

Hello,

Greetings for the day!

I am xxxxxxx and I am contacting you after looking at your website- .

We are a Leading Indian Based SEO & Web Development Company and one of the very few company which offer organic SEO services with a full range of supporting services such as one way themed text links, blog submissions, directory submissions, article writing and postings, etc.

We are a team of 50+ professionals which includes 18 full time SEO experts. We are proud to inform you that our team handled 100+ SEO projects and obtained 40000+ manually built links in the past 1 year.

We will be glad to assist you with offering our services. Please let me know your Interest so that we can tell you more about Our Services.

Thanks
—————-
xxxxxxx xxxxxxxxxx
Online Marketing Consultant

Now there are a couple reasons why I would never deal with any of these companies:

  1. Firsty, they sent me SPAM!
  2. If I can’t be found on search engines, then how did they find me in the first place?
  3. They always use gmail, hotmail, live e-mail accounts. If they truly were a reputable company they would use their own corporate e-mail address. For me they represent fly by night companies that I would avoid at all cost.
  4. Similarily, in many casess, the e-mail address name does not match the sign-off name in the e-mail. Make me wonder?!
  5. Why hire a company to do what you can do yourself? SEO is very basic and there are no tricks that they possess that you cannot do yourself with a little time.
  6. Most importantly, any company that promises specific results I would avoid at all costs! No one can garantee where you will show up on any search engine since the equations behind indexing are private and always changing. A SEO consultant can say they will optimize your site, and should be able to improve your ranking, but to say you will end up on the 1st page is just ridiculous!

Also, please remember that you can’t be at the top of search engine searches for every keyword! So anyone can always claim that you are not at the top of search engine ranking for some keyword. You have to concentrate your efforts on a select group of keywords and work your site around the keywords you have chosen.

Another important thing to note about SEO is that it is an on-going process. There is always more that can be done. So it is important to fix a realistic goal and aim for that. Once you have done your SEO, you should then review your site statistics for a couple week or months, and then define a new attack plan.

At the end of the day though, if you want to get someone to do some SEO for you that is fine, but find yourself a web developer through your network, yellow pages, the person that developed your site. Then validate there abilities by asking for examples and references (anyone can claim to be a SEO expert). Just stay away from the SPAM, unsolicited SEO as they are questionable (refer to the list above).

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
April 23rd, 2011

Domain Registry of Canada – a SCAM?

I recently got a letter in the mail from Domain Registry of Canada indicating I had to renew 2 domains. Their letter, and envelop is as close as you can get to resembling official Government of Canada letterhead, but isn’t. Actually what then send out in an invoice for services, for which you have not yet even signed up for! But if you return the letter with payment you are in fact agreeing to switch your business over to them!

Domain Registry of Canada Letter

Domain Registry of Canada Letter

So what or who is Domain Registry of Canada exactly? They are merely a domain registrar, a company that offer the service of registering your website address (your .com, .ca, .net, …).

Here is some of their info (all freely available on the internet)
From their own website, we get their contact information:

Domain Registry of Canada
PO Box 4577
Markham, Ontario
L3R 5M7
Tel: (866) 434-0212

From the Better Business Bureau we find out the ‘kind’ people who run this nice business are:

Simon Benlolo - President
Mr. Peter Kuryliw - Vice President Oper
Mr. Alvin Chen, Supervisor 

So how did they get my contact information? Well, when you register your domain you have to give contact information and for the most part, this information is freely accessible by anyone, unless you pay extra to make it private which almost no one does!

Are they running a scam? I guess not, as they are offering a service, but the method in which they are doing it is most questionable to say the least. They used deceipt and confusion to get new clients!

What should I do? Simply put, nothing! Ignore the letter. If you did your own domain registry, then simply renew it yourself. If on the other hand you had a web developer, friend, … do this for you, contact them and ask them to ensure it is re-registered for another year, or 2, or 5…! Ignore these people. I would not ever want to deal with people, or a company that basically prey on people and send out this type of ‘marketing’ materials. If this is their business ethics… Beyond which, their fees are x4 more than anything I have ever made my clients pay. It is highway robbery, but I no many people will fall for their letter, be all worried and get locked into doing business with them,but hopefully this post will save a few people from making this mistake!!! Other online article simply suggest posting their return envelop (without putting any postage on it) so they end up having to pay for postage and then they have to process an empty envelop wasting their time. It is up to you.

If you are a Canadian, I would urge you to file a complaint by using the Online form found at http://www.competitionbureau.gc.ca/eic/site/cb-bc.nsf/frm-eng/GH%C3%89T-7TDNA5 and referencing http://www.competitionbureau.gc.ca/eic/site/cb-bc.nsf/eng/00528.html in your complaint. The more people complain, the more likely this type of practice will be stopped! It is up to you and only takes a few minutes of your time and may save other people from being had!!!!!

Throw their paperwork in the garbage, complain about them to your local MNA, your local Better Business Bureau, but please do not fall for their antics!

Other Links of Interest:

Simply Google to find many more stating the same thing.

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
September 11th, 2010

Web Devlopment Learning Resource – Where to Start

I short while I was asked to sit down with a graphic artist who also was a web developer because they wanted me to teach them what I knew because I had commented on their work to their client (who happened to also be one of my database clients).

I was more than happy to oblige, as I have no problem trying to help someone else out when I can.

They basically knew how-to use Dreamweaver, but that was about it. So I went over a number of things that I have learnt in the past few years and thought I should post them here should they be useful to someone else. So here goes…

The first aspect I wanted to emphasize was the importance of clean code! What does this entail, a couple of simple things really:

  • CSS driven design
  • Separate files for CSS, JS
  • Clean directory structure. Don’t dump everything into the root folder, but rather make a simple directory structure (images, js, css, …)
  • When appropriate add comments within your code so you can find yourself at a later date.
  • Ensure that your design is cross-browser compliant. Long gone are the days that Internet Explorer is the only web browser, so make sure your website works in the other browsers (Firefox, Opera, Safari, and many more…)
  • Ensure your code is W3C compliant by simply testing each of your pages with their Free Validation tools (links provided below). Take some time to get to know the standards and utilize all the free information this organisation provides.

 

W3C Links

 

Other Useful Links

 

Javascript and JQuery

At some point or another you will be faced with the need to add some form of automation to your webpage. At that point you will need to look into javascripting,… I would urge you to simply go straight to learning JQuery instead. It actually use javascript, but is simpler and comes with many already existing functions and samples. Believe me, this will save you time and frustrations in the long run and will give you tremendous capabilities right from the start. Another beauty is that unlike custom javascript functions, jQuery is crossbrowser compatible! This will save you countless hours of testing, troubleshooting and finding browser hacks!!! Check it out for yourself at: http://jquery.com/

I truly hope this brief article gives you a jump start into web development and various online resources at your disposal. Have fun!

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
June 6th, 2010

PHP Random String Generator

Have you ever need to generate a random string or generate a unique id using PHP. Below is a complete example of how to do so. Simply copy the entire code into a new php page and then open it.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>PHP Random String Generator</title>
</head>
<body>
<?php
# AUTHOR: 		Daniel Pineault, CARDA Consultants Inc.
# DATE:			2010-06-25
# PURPOSE: 		Generate a random string or unique Id
# COPYRIGHT: 	You are free to use this code as you wish as long as
#	 			this header is include in the final work.  This is 
#				provided 'AS IS' and I assume no liability for its
#				usage.
#			

	foreach($_POST as $key=>$value) {
		$$key = strip_tags($value); //sanitize provided user entries
	}
 
	if(isset($GenRndStr)){
		$sUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		$sLower = "abcdefghijklmnopqrstuvwxyz";
		$sNumbers = "0123456789";
		$sSpecial = "!@#$%^&*()[]{},.;:'/\~-+=|<>";
 
		if($UCase==1){
			$s .= $sUpper;
		}
		if($LCase==1){
			$s .= $sLower;
		}
		if($Nbr==1){
			$s .= $sNumbers;
		}
		if($SpecChrs==1){
			$s .= $sSpecial;
		}
		if(strlen($ExChrs)>0){
			for($k = 0; $k <= (strlen($ExChrs)-1); $k++){
				$s = str_replace($ExChrs{$k}, "", $s);
			}
		}
 
		$sLen = $RandStrLen;
 
		for($i = 1; $i <= $sLen; $i++){
			$sRandString .= $s{rand(1,strlen($s))};
		}
	}
?>
<h1>PHP Random String Generator</h1>
<form id="RndStrGen" name="RndStrGen" method="post">
<table border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td valign="top"><strong>Password Characteristics</strong> </td>
    <td><input type="checkbox" id="UCase" name="UCase" value="1"<?php
			 if ($UCase == 1) {
			 	echo ' checked="checked"';
			 }
			 ?> />
      Upper Case Characters<br />
      <input type="checkbox" id="LCase" name="LCase" value="1"<?php
			 if ($LCase == 1) {
			 	echo ' checked="checked"';
			 }
			 ?> />
      Lower Case Characters<br />
      <input type="checkbox" id="Nbr" name="Nbr" value="1"<?php
			 if ($Nbr == 1) {
			 	echo ' checked="checked"';
			 }
			 ?> />
      Numbers<br />
      <input type="checkbox" id="SpecChrs" name="SpecChrs" value="1"<?php
			 if ($SpecChrs == 1) {
			 	echo ' checked="checked"';
			 }
			 ?> />
      Special Characters (!@#$%^&*()[]{},.;:'/\~-+=|<>)</td>
  </tr>
  <tr>
    <td valign="top"><strong>Characters to Exclude</strong></td>
    <td><input type="text" id="ExChrs" name="ExChrs" value="<?= $ExChrs ?>" /></td>
  </tr>
  <tr>
    <td><strong>Password Length</strong> </td>
    <td><input type="text" id="RandStrLen" name="RandStrLen" value="<?= $RandStrLen ?>" /></td>
  </tr>
</table>
<p>
  <input type="submit" id="GenRndStr" name="GenRndStr" value="Generate String" />
</p>
</form>
<?php
	if(isset($sRandString)){
		echo "<p>".$sRandString."</p>\n";
	}
?>
</body>
</html>

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print