Skip to main content

Posts

Showing posts from June, 2008

Reason For The Lack of Posts These Days...

Today I’ve got a bad news for you guys. It’s that I won’t be able to blog for almost a month. Sorry guys, it’ I know it’s happened in the past but this time I’ve got a pretty good excuse – EXAMS. That’s right my exams starts 10th July and guess what, I haven’t studied much yet! It happens…always happens… Hope you’d understand my problem, in the mean time you may want to read some of my recent posts that got good readership: Installing Apache and PHP on your PC Designing a Simple Order Form Application in PHP Designing a Simple “Quote of the Day” Script in PHP Creating a ‘Contact Us’ Form (E-Mail Version) Designing a Simple ‘Shout Box’ Script in PHP A Complete Note Keeping Application in PHP Creating a Simple Poll Script in PHP ...

Creating Tool-Tip Text for WebPages Using CSS Only

[ You might also be interseted in Deigning a Simple HTML Menu-Bar Using CSS ] All right, so today we are going to use CSS along with some HTML to create Tooltip text for WebPages without using JavaScript. Yeah, you heard it right using only CSS and of course HTML. Do I need to explain what a Tooltip is, BTW? Nah, you guys already know it. I do not think many sites use tooltips or anything of that sort on their websites but in case you do or you just want to learn, read on… Well, the first thing that I want to tell is that the basic technique I’ll be using to create tooltips is not mine, I saw someone using it for a slightly different purpose, I changes it to suite mine. As I said earlier we’d be using CSS and HTML only, I guess HTML is easier so here it is: <a href= "#" class= "tooltip" >Hover Here <span >This is the Tool-Tip Text </span > </a > As you can see there is nothing special, ...

Basic Web Scraping: Pulling Out Data From Google Search Results

[ UPDATE (22-AUG-2009): THIS IS THE NEW WORKING VERSION.] Today we are going to discuss a bit advanced topic, not in the sense that it’d be difficult to understand (I always try to make things easier anyway) but that you won’t find an apparent use of it. What we are going to do today is what is called Web Scraping. By the way web scraping means retrieving data from web and pulling out useful information out of it for our use. Of course this wouldn’t be the next best web scraper rather it would la a basic foundation on how simple a web scraper can be. OK let’s kick off guys! As is obvious we are going to scrape Google’s Web Search Results to retrieve the number of pages indexed for a search term. To retrieve results for a search term we need the URL, for this fire up your favorite Browser and browse to the Search Engine’s (Google, or whatever) homepage, type in any search query and hit enter. OK now look at the address...

Creating a Simple HTML Form Validation System Using JavaScript

OK, so today we are going to create a simple Form Validator Script using JavaScript that would not let a HTML form be submitted unless all required field are filled in. JavaScript is widely used for this purpose as it does not need server processing hence no form sending and pageload is required. When you are using data submission via form on your website there are a few other methods that you can employ other than JavaScript; first, not to use validation at all (NOT RECOMMENDED), second, to use validation in the script and make it show appropriate message (need pageload). So definitely we’ll be using JavaScript and you should in most cases, too. Let’s kick off guys! Now before we begin I want to tell you one thing, we will only be checking (validating) if all the required fields are filled or not and NOT whether what is filled in is acceptable. Of course we can use JavaScript to validate whether, let’s say the filled email address is ...

Deigning a Simple HTML Menu-Bar Using CSS

In this post I’m going to show how you can create a menu-bar (list of hyperlinks) using CSS styling. This requires that you at least have some basic knowledge of HTML and preferably CSS too. If you can’t figure out what a menu-bar looks like, scroll to the bottom. Seen! Though pretty much the same can be implemented using tables but that is not web developers prefer. In HTML there is not standard tag for creating a menu like item therefore we would be customized or style a standard tag. We’ll be using the ‘unordered list’ <ul></li> tag to do so, in this case every item i.e. <li></li> will be items in the menu. Let us first start by creating an unordered list as follows: <ul>     <li>Item 1</li>     <li>Item 2</li> </ul> It shows up something like below: Item 1 Item 2 Obviously this is not what we want; ite...

Blogger: Method to Add 'Link to This Post' Widget on Your Posts

[ Today I’m going to provide you with a code that you can put on your Blogger Blogs. It’ll give your visitors a very easy way to link to your posts if they like it. Scroll to the bottom to see it in action! You might also want to read New Working Method of Making Blogger Title Tags SEO Friendly ] When it comes to Search Engine rankings, link popularity is no doubt one of the most important factors especially organic link popularity. Nowadays Search Engines’ algorithms have become so intelligent and sophisticated that they could differentiate between different types of links; paid, reciprocal, organic etc. to name some, automatically and not let discouraged factors manipulate rankings much (in some cases by even penalizing those site). Coming to Organic Link Building, there is no better way to do (or at least increase) Link Building than to ask or encourage your visitors. You see, I’ve it at the bottom of this post. This way yo...

One More Use of Web Cookies

Ok, so we were discussing about Cookies in the last post, continuing the discussion today we’ll see one more example of where cookie is almost irreplaceable by any other method. If you remember the post Creating a Simple Visitor Counter in PHP , although we named it ‘Visitor Counter’, what it actually counted was the number of times a page was requested. So, for example one person can request a page ten times and counter would show ten but actually the number of visitor id ONE. Ten is the number of page views. Now you may have got what I’m up to today! Yeah we’ll employ cookies to track whether consecutive page requests came form the same visitor or not. If it is then another counter for number of page views will be incremented instead. We cannot use Session Variables as they by default last only until the session is over. We’ll make the cookie expire after twenty four hour or one day period after that again ...

Enhancing the Poll System Using 'Cookies'

Umm, actually not the usual ‘Cookie’ that we eat! Those of you who have created the Polling System that we discussed in Creating a Simple Polling System in PHP , know that the system was simple enough to let the same user vote over and over gain multiple times. It is an open invitation to spammers and other peoples to manipulate the poll. The real-world polling systems do not let people do that. So, unless we implement some method to fight that, out Polling System can not be used on websites. So, you’ve got to read along if you are interested in creating a ‘real’ polling system. One more thing, it’s not just polling system that requires knowing a unique visitor, there are plenty more applications of it. We have previously discussed in What is Session Control/Variables? that Session Control helps us know whether consecutive requests are made by the same user or not thus it can be used in polling system to not let th...

Enhancing Search (Input) Boxes Using JavaScript

Time for some JavaScript action. JavaScript as you know is a client-side web scripting language and is the best choice for any client-side scripting application for the web. Today we’re going to employ some basic and simple JavaScript methods to enhance a Search (Input) Box as in the image above. You’ve probably come across this type of Search Box before. In the text box initially is written ‘Search’ or something of that sort but as soon as you click or focus on it, the field becomes empty for you to type in, again when it is left blank and focus is taken off it, field changes back to have the initial text. I don’t actually see a big enough reason why people employ this technique but one common reason might be when there is not enough space to label the search box, this technique can use the Text Box to label itself. OK, enough discussion, now let’s have a look at the code: <form action="SCRIPT-NAME" meth...