Yearly Archives: 2011

Validating url using javascript

Some times we might need to check if the url entered by the user in the text box is a valid one or not. Here is a sample code to check that. <html> <head> <script> function checkUrl() { var theUrl=document.getElementById(‘url’).value;

Posted in Javascript Tagged with: ,

Generating a captcha code using PHP

This script generates images (known as “Captcha’s”) which contain security codes used for protecting a form from spam bots. By encoding a ‘password’ inside an image and asking the user to re-enter what they see you can verify the user

Posted in Php Tagged with: ,

Javascript code for selecting/de-selecting all Checkboxs

Check boxes in web pages allow the users to select multiple options while they fill out a HTML form. If the HTML form consists of large number of checkboxes , then individually selecting and de-selecting all the checkboxes will be

Posted in General Tagged with: , ,

print_r() Versus var_dump()

There are many functions available in PHP to debug a variable. This function can be used to store value in an array or other another object and it is important to troubleshoot the codes. Let us see some of them

Posted in Php Tagged with: , ,

Deleting Session Cookie in Webbrowser control.

Cookies are used in websites to store user information which in turn improves the user experience. C#.net has a webbrowser control that helps to create application helpful to navigate and crawl website automatically. It will be required to delete these

Posted in c# Tagged with: , ,

Javascript to count the number of times user clicks on a button

In some scenarios we might need to count the number of times a particular user has clicked a button or any other element in a web page. There is no direct way like a static variable to count the number

Posted in Javascript Tagged with: , , ,

C# – Handling symbols in webbrowser control

When we handle symbols like Ø,½ and ± in C#.net with the webBrowser we will face some incompatibility issues even if we set a corresponding character encoding for the browser control . In order to overcome this issue we can

Posted in c# Tagged with: ,

Page Redirection in php

When we want to move from one page to another we have to use page redirection here is a php code that deals with page redirection .Page redirection can be done in php page .sing header() which is used to

Posted in Php

Using Associative array

When we use Curl option to post some values .We might face some issue where the data posted will not be posted in the web page .Here is a scenario when we got this same kind of issue and that

Posted in Php Tagged with: ,

Sample PHP code for creating forgot password feature in any website

Most of the websites will require the users to register them for getting username/password which can be used for logging into their website. It is very common that the users forget their password. So, the websites should allow the users to

Posted in MySQL, Php Tagged with: ,