Can anybody tell me if it is possible to have page numbering on the side of the page? I mean on the right side on odd pages and on the left side on even pages.

Can anybody tell me if it is possible to have page numbering on the side of the page? I mean on the right side on odd pages and on the left side on even pages.

I have followed up on the solution proposed by alexises, completing the code.
\documentclass[twoside]{article}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{fancyhdr}
\fancypagestyle{Plain}{%
\fancyhf{}
\fancyfoot[EC]{%
\begin{tikzpicture}[remember picture,overlay]
\node[xshift=3cm,font=\bfseries] (number) at (current page.west) {\Huge[\thepage]};
\end{tikzpicture}
}%
\fancyfoot[OC]{%
\begin{tikzpicture}[remember picture,overlay]
\node[xshift=-3cm,font=\bfseries] (number) at (current page.east) {\Huge[\thepage]};
\end{tikzpicture}
}%
}
\fancypagestyle{nonums}{%
\fancyhf{}
\fancyfoot[OC]{}
\fancyfoot[EC]{}
}
\pagestyle{Plain}
\begin{document}
\lipsum[1-10]
\lipsum[11-15]
\thispagestyle{nonums}
\lipsum[16-18]
\end{document}
For a page without the page number use \thispagestyle{nonums} at an appropriate point in the document.
Screenshot:

Later:
I wanted an approach that did not rely on the twoside option. tikzpagenodes.sty makes this possible because the locations of the page numbers are relative to the current text block, not the edge of the page.
\documentclass{article} %% Use [twoside] if needed
\usepackage{lipsum}
\usepackage{tikzpagenodes}
\usepackage{fancyhdr}
\fancypagestyle{Plain}{%
\fancyhf{}
\fancyfoot[C]{%
\ifodd\thepage
\begin{tikzpicture}[remember picture,overlay]
\node[xshift=2cm,font=\bfseries] (number) at (current page text area.east) {\Huge[\thepage]};
\end{tikzpicture}
\else
\begin{tikzpicture}[remember picture,overlay]
\node[xshift=-2cm,font=\bfseries] (number) at (current page text area.west) {\Huge[\thepage]};
\end{tikzpicture}
\fi
}%
}
\fancypagestyle{nonums}{%
\fancyhf{}
\fancyfoot[C]{}
}
\pagestyle{Plain}
\begin{document}
\lipsum[1-10]
\lipsum[11-15]
\thispagestyle{nonums}
\lipsum[16-18]
\end{document}
Here is the non-twoside output:

And here is the twoside output:

\[...\] in the Tikz node produced errors; 2) There were two missing ';' characters. I did not want to draw attention to the problems. Will Durant: "To speak ill of others is a dishonest way of praising ourselves. . . let us be above such transparent egotism." I simply presented an approach based on what was essentially a very good idea.
– sgmoye
Aug 08 '14 at 09:55
You should consider using TikZ with fancyhdr
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[EC]{%
\begin{tikz}[overlay]
\node[font=\textbf,xshift=0.5cm] (number) at (current page.west) {\[~\thepage~\]}
\end{tikz}
}%
\fancyfoot[OC]{%
\begin{tikz}[overlay]
\node[font=\textbf,xshift=0.5cm] (number) at (current page.east) {\[~\thepage~\]}
\end{tikz}
}%
}
Another way of doing this using the background package. Stealing from the manual a little, you can get:

(I could only display an even page next to an odd page...)
The LaTeX for this is fairly easy:
\documentclass{article}
\usepackage{lipsum}
\usepackage[pages=all,color=black,opacity=1,scale=4,contents={},angle=0,%
contents={}]{background}
\usepackage{ifthen}
\AddEverypageHook{\ifthenelse{\isodd{\value{page}}}%
{\backgroundsetup{position={0,-0.15\textheight}, contents={[\thepage]}}}%
{\backgroundsetup{position={0.34\textwidth,-0.15\textheight}, contents={[\thepage]}}}%
\BgMaterial%
}
\pagestyle{empty}
\begin{document}
\lipsum\lipsum\lipsum\lipsum
\end{document}
The placement of the page numbers is a little haphazard and could be improved. I don't really like the format of [x] for the page numbering, but for this I followed the OP. I would prefer something like a greyed -x-. It's also not hard to put the number in a \fbox etc.
Finally, I should say that I am cheating a little here because background uses tikz behind the scenes, so this is similar to the solution that @alexises has already posted.
Edit
If you want to drop the page numbers from some pages then you can do it by adding using the following modification and putting \PageNumberfalse on the pages where you don't ant numbers (this will only take effect for one page):
\documentclass{article}
\usepackage{lipsum}
\usepackage[pages=all,color=black,opacity=1,scale=4,contents={},angle=0,%
contents={}]{background}
\newif\ifPageNumber\PageNumbertrue
\AddEverypageHook{%
\ifPageNumber%
\ifodd\value{page}%
\backgroundsetup{position={0,-0.15\textheight}, contents={[\thepage]}}%
\else%
\backgroundsetup{position={0.34\textwidth,-0.15\textheight}, contents={[\thepage]}}%
\fi
\BgMaterial%
\fi\global\PageNumbertrue% by default number all pages
}
\pagestyle{empty}
\begin{document}
\lipsum\lipsum\PageNumberfalse\lipsum\lipsum
\end{document}
(For good measure I dropped the use of the ifthen package...not sure why I used it before:)
\documentclass{...}and ending with\end{document}. – Aug 06 '14 at 11:44scrlayer-scrpage. – Johannes_B Aug 06 '14 at 12:01