Narendra Dhami

My Site

Archive for October, 2008

Introducing xdebug

Posted by Narendra Dhami on October 23, 2008


This article is the first installment of a five-part series of articles covering xdebug, a free and open source swiss army knife tool for PHP developers. xdebug is a PHP extension created by Derick Rethans, one of the PHP core developers. This week, we will show you how to install xdebug and introduce you to some of the basic features. In the subsequent parts of this article series, we will have a closer look at one of xdebug’s main features, namely tracing, profiling, debugging, and code coverage. More …

Advertisements

Posted in PHP | Leave a Comment »

Monitoring File Uploads using Ajax and PHP

Posted by Narendra Dhami on October 22, 2008


Introduction

Because of the limitations of HTTP, it is difficult to monitor the status of files as they are uploaded via HTML forms. While other programming languages have built-in methods to monitor file uploads, PHP does not. This article shows how to implement such a solution in PHP.

In order to achieve this, the APC (Alternative PHP Cache) PHP extension is required, as well as PHP 5. Specifically, APC 3.0.13 or newer and PHP 5.2 or newer are required for the code in this article to work. We will cover installation of APC in the next section. It is assumed you already have a working PHP 5.2 installation.

In this article we will develop a solution that will allow users to upload a file from their computer using HTML forms. We will then determine the progress of the upload while it is in progress using Ajax, and display the status to the user. More …

Posted in PHP | Leave a Comment »

Installing APC in Windows

Posted by Narendra Dhami on October 22, 2008


Introduction

APC (Alternative PHP Cache) is a PHP opcode cache. It stores PHP pages in RAM and reduces hard disk activity. This makes a real difference to the performance in Moodle, and you should be able to achieve a 50% increase in system capacity and your CPU will be 50% less busy.

This guide is for installation of APC on a Windows server. The instructions have been tested on a Windows 2003 server, and they should also be applicable if you are using Windows XP as a test server. More …

Optimizing with APC

Opcode caches save energy, expenses, improve overall user experience on web sites, and it’s often one of the simplest optimizations to implement. This article will explain the basics of installing, configuring, and tuning an opcode cache for PHP, the Alternative PHP Cache (APC). More…

Posted in PHP | Leave a Comment »

Top 10 Online Resources for Learning Japanese for Free

Posted by Narendra Dhami on October 22, 2008


Find

Posted in General | Leave a Comment »

20 More Hard Core SEO Tips

Posted by Narendra Dhami on October 17, 2008


Last year’s article on hard
core SEO tips
proved to be the most popular article on SEO Theory. It
still receives a respectable amount of traffic. I was stuck for a topic
that morning and decided to challenge people’s preconceptions
about search engine optimization.

All year long I’ve thought to myself, “I wish I could
do THAT again”. Well, I can’t promise you’ll have as
much fun with these tips as with last year, but they do represent a
year’s reflection on the lessons we can learn from challenging the
ideas that have become so strongly fixed in the collective SEO wisdom.

20 More Hard Core SEO Tips – The List

  1. Create a Web site with unscannable copy and get each page to
    rank for at least 2 expressions.
  2. Create a Web site without using targeted keywords in your copy
    and get each page to rank for at least 2 expressions.
  3. Create a web site using tables for page layout, ensuring that
    the text is linearized, and get each page to rank for at least two
    expressions.
  4. Inspire 5 other sites to link to a press release WITHOUT using
    a press release distribution service AND without asking for links.
  5. Compare your server log referrals for Yahoo! and Microsoft
    Search to your Google Analytics referral data for those search
    services.
  6. Create a splash/intro page. Use only Flash or only an image
    (no embeds) and promote it to the top of four (4) competitive queries.
  7. Obtain 10 FREE 1-way, value-passing links from separate
    domains that you don’t own for a single site in one hour without
    using link dropping scripts, forum signatures or posts, blog comments,
    or social media sites.
  8. Reverse the polarity of your Web site. If it’s mostly
    graphics, make it mostly text. If it’s mostly text, make it
    mostly graphics. If it’s mostly user-generated content, make it
    mostly your own unique, coherent, original content. If it’s not
    mostly UGC, make it mostly UGC.
  9. Create a schmuck list. Add to it every time you come across
    someone who posts self-promotional comments on blogs, forums, or social
    media sites; every time you read a blog post from someone who equates
    blogs with social media; every time you come across someone who says
    links are the most important part of SEO; every time you see someone
    attribute TrustRank to Google. Add yourself to the list each time you
    agree with the schmucks until you learn to stop being a schmuck.
  10. Find 3 active SEO forums where people don’t talk about
    Google PageRank updates.
  11. Write down your 10 best previously unshared SEO tips, tricks,
    techniques, or tactics. Lock the list away and never share it on the
    Web or at a conference.
  12. Register a domain. Write a humorous essay on how to brush your
    teeth, or how to wash your car, or how you felt the first day of
    school. Put the essay on the domain. Forget about the site.
  13. Create a Web site in a language you’ve never used
    before. Get the Web site indexed in appropriate search engines. Get the
    site to rank for at least 2 expressions.
  14. Write an essay or tutorial on SEO. Do not discuss on-page
    factors, links, or social media.
  15. Ask 3 kids aged 7-10 what their favorite sites are and why
    they like those sites. Ask 3 kids aged 25-30 what their favorite sites
    are and why. Find 3 points in common between the 2 groups.
  16. Design a new navigation system for your Web site. Install it
    without removing the old navigation system.
  17. Create a forum signature that links to one of your
    competitors’ sites in a flattering, sincere way.
  18. Find 10 obscure, well-written Web sites that are NOT blogs and
    which contain thoughtful articles that interest. Send an email to each
    site owner that sincerely compliments their site 5 times. Use 250 words
    or less. Do not mention your own site or explain what you do.
  19. Create a 10-doorway page site. Get the pages to rank in Google
    without invoking a penalty or filter.
  20. Pick an expression no one searches for. Within 6 months,
    generate at least 100 natural queries for that expression.

20 More Hard Core SEO Tips – The Explanations

Professional search engine optimization keeps moving forward. If you
don’t continue to challenge yourself, you stagnate. And people who
stagnate in this industry are uncompetitive.

Create a site with unscannable copy. Why?
Because most Web content is not scannable. Because most Web news copy is
not scannable. “Write for the Web” is a non-sensical
expression. You write for people, not the Web, and people will read
anything that is well-written and engaging. People will stop and read
anything that captures their interest. They’ll leave anything that
bores them. Making your copy scannable doesn’t make it less
boring.

Create a site without targeting keywords. Put
yourself in everyone else’s shoes. You were once there. Create a
site about a topic and focus on the topic. Toss out all your SEO
knowledge and skill. Once you find out what the pages naturally attract
search referrals for, optimize for those referral expressions.
Let go of your preconceptions about what you SHOULD be doing and learn
to respond to what people are searching for.

Create a site using tables for page layout. One
of the dumbest ideas ever passed around the SEO community was that
it’s easier to design search-friendly content with CSS/DIVs than
with tables. If you don’t know how to make a clean page design
using tables, you don’t know enough about tables to form an
opinion on their use in Web design. Tables
were originally used for page layout
, and CSS1 was NOT intended for page
layout. Search optimizers need to know how to optimize page designs
without acting like illiterate code snobs.

Inspire 5 other sites to link to a press release.
SEOs like to use press releases and it shows: SEO press releases tend to
be ugly, unimaginative, and brutally distributed across as many Web PR
services as possible. If you can create an elegant, attractive, and
interesting press release, you’ll get more visbility and traffic
than from the cookie-cutter model the SEO community loves.

Compare server log referrals to Google Analytics.
Once you’ve seen just how much information Google Analytics fails
to report to you, you’ll wonder why you ever liked it in the first
place. Google does not seem to know what search referrals from other
engines look like. But YOU need to know what they look like.

Create a splash/intro page. I love these pages.
SEOs shake in their boots, roll their eyes, and get out their
floppy-eared SEO tutorials when they run into splash pages. Piffle.
Learn how to optimize for anything and you’ll quit rolling your
eyes needlessly. You should be able to optimize any Flash-only site in
your sleep.

Obtain 10 free links. I worded this as carefully
as I could, so as to rule out all the cheap tricks SEOs tend to rely
upon. Resourceful SEOs can get those links quickly. How resourceful are
you?

Reverse the polarity of your Web site. SciFi
reference included for Todd Friesen’s eye-rolling enjoyment.
However, as an SEO technician you need to be able to optimize any kind
of content. The content style you favor is the one you least need to
practice optimizing.

Create a schmuck list. You’ll never get
out ahead of the crowd if you keep agreeing with all their mediocre
ideas. When you learn to distinguish your own creativity from other
people’s rehashed SEO tips, you’ll magnify your SEO powers
tenfold. Question everything other SEOs say. Challenge them to back up
their points with facts, data, and proof. Most of them CAN’T.

Find 3 active SEO forums …. This will
teach you to recognize just how easily the SEO community obsesses over
nonsense. Your schmuck list will explode while you are on this quest.

Write down your 10 best tips. If you don’t
have 10 SEO ideas you haven’t shared with other people on the Web,
you need to shut up. If you still have 10 unshared ideas, you have an
“SEO secret”. It’s your competitive advantage. So shut
up anyway and enjoy the knowledge that only you possess. Stupidity is
its own reward, and people who give away their competitive advantage are
just plain stupid.

Build and forget a domain. Check three things
after six months: search referrals, inbound links, and the time people
spend on your site. Repeat the evaluation at the 12-month mark. If you
learn nothing from the experiment, start over again and keep doing it
until you learn something — anything.

Build a site in another language. You have no
idea of the SEO lessons this one experiment will teach you.

Write an SEO tutorial …. If you cannot
think of anything to put into an SEO essay that doesn’t mention
on-page optimization, links, and social media MUCH YOU HAVE YET
TO LEARN
about SEO, my young Padawan.

2 Age Range Focus Groups. You’ll be amazed
at how much you’ll learn about successful Web site promotion just
by asking people what they like and why they like it. But comparing the
answers you get from different demographic groups helps you see the core
values that matter most.

Add a second navigation system to your site.
Think this is unnecessary? Then find a way for the second navigation
system to add value. Search engine optimization adds value. Objections
just get in the way of doing what SEOs need to do best: add value.

Promote a competitor through your forum
signature
. Do this for six months and you’ll eventually stop
obsessing over how many links the other guy has.

Compliment other sites about their content. This
will teach you how to treat Webmasters (who have never heard of you
before) like they were human beings rather than link slaves waiting to
do your bidding.

Create 10 doorway pages. Search engines
don’t hate doorway pages, just spammy doorway pages. Every page on
your site can act like an entry page. This exercise will teach you the
difference between Web spam and content. Script kiddies won’t
understand.

Build a query space. If you can generate 100
natural queries (that excludes all rank-checking) for an unused
expression, you can help any web site build its search referral traffic.
(NOTE: This exercise won’t make clients and prospects any smarter
— just you.)

20 More Hard Core SEO Tips – What They Mean

Last year I tried to challenge people’s assumptions about
HOW to optimize for search. This year I want people to think about what
“search engine optimization” really means.

It’s not about links. It’s not about social media.
It’s not about being tricky and deceptive.

Search engine optimization gives us the power and the freedom to
participate in search as searchers, publishers, and even as indexers. We
have to use that power responsibly, but more importantly we have to
appreciate it for what it is: knowledge that most people don’t
possess.

Posted in SEO | 2 Comments »

Regular Expressions (Part1) – Basic Syntax

Posted by Narendra Dhami on October 14, 2008


Read …

Posted in General | Leave a Comment »

10 Useful articles about Database design

Posted by Narendra Dhami on October 3, 2008


This is a list of ten useful articles about database design which includes some tips and practical suggests to help you to design quickly databases for your web projects.

The list includes some tips to define relationships-entities model, common database design mistakes, database normalization, how to use PHP and SQL to create tables and relationships and a correct approach to define relationships between tables. More …

Posted in MySQL | Leave a Comment »

Seven habits for writing secure PHP applications

Posted by Narendra Dhami on October 3, 2008


Security in a PHP application includes remote and local security concerns. Discover the habits PHP developers should get into to implement Web applications that have both characteristics. 

When it comes to security, remember that in addition to actual platform and operating system security issues, you need to ensure that you write your application to be secure. When you write PHP applications, apply these seven habits to make sure your applications are as secure as possible:

    * Validate input
    * Guard your file system
    * Guard your database
    * Guard your session data
    * Guard against Cross-Site Scripting (XSS) vulnerabilities
    * Verify form posts
    * Protect against Cross-Site Request Forgeries (CSRF)

More …

Posted in PHP | Leave a Comment »