Blog Archives

Getting current Page Name in PHP

If you want to get the current page name , php provides you with an inbuilt function $_SERVER[‘PHP_SELF’]. $_SERVER[‘PHP_SELF’] can be used to obtain the current name in the php.It will be necessary for us to use this $_SERVER[‘PHP_SELF’] for

Posted in Php Tagged with: ,

Basics of Session and Cookies

We know that Webpages are getting displayed using stateless Protocol. So there should be someway for keeping the session of the user navigating the webpages within a website. Session variables and Cookie variables can be used for this purpose. Basically Session variables

Posted in Basics of Internet, Html, Php Tagged with: ,

MySQL – Resolved null issue in query.

We have faced strange issue with MySql old version (version 4). Our php file will pass a querystring variable “id”. It can have a value or it can be empty in some situation. Initially, we used below code, $id=$_GET[‘id’]; $sql=”select

Posted in MySQL Tagged with: ,

Dynamically changing/displaying web page content using javascript without refreshing the page

Sometimes we may need to change the content displayed in the webpage frequently. Javascript will enable achieving this without the need for refreshing the webpage.(i-e without requesting the page again). Below steps are needed for doing this. – All the

Posted in Javascript, jQuery Tagged with: ,

For using javascript Calendar in web page

1. To use calendar in our page, we should include one JS file in our project on the same path of our page. 2. Paste the following line in <head> <SCRIPT LANGUAGE=”JavaScript” SRC=”CalendarPopup.js”></SCRIPT> <SCRIPT LANGUAGE=”JavaScript” ID=”js1″> var cal1 = new

Posted in Javascript Tagged with: ,

Javascript validation for radio button in HTML form

HTML is having INPUT tag withradio as type to display radio button in the HTML form. Multiple input tags should be given same name to make it one group. Consider below code which will allow the user to select any one

Posted in Javascript Tagged with: ,

Handling Date and Time in PHP/MySQL

Date and time can be inserted into mysql table in specific format only. But php will support different types of date and time formats. So, we should convert the date and time from php into specific format before inserting the

Posted in MySQL, Php Tagged with: ,

Avoiding multiple lines in tag

In some situation (viewing in different browsers) the single <td> tag displays content in two lines. If you want to display sentence in single line always in all browsers then use <td> attributes ‘nowrap’ For example,you may want username/userid/Name to be

Posted in General Tagged with: ,

Steps for PHP installation

We can follow below steps for installing php with Apache server. Install Apache-2 while (installing it give domain name and server name as localhost) Create a folder inside Apache with name=”php”. Unzip the file “” inside the folder “php”. Rename the file “php.ini-recommanded”

Posted in Php Tagged with: ,

Cross browser web development

The important challenge for any web developer is making the website work in many different types of browsers(IE, FireFox, Safari, and Chrome) and also in different browser versions. To achieve this, we may need to write separate code for each

Posted in General, Html Tagged with: ,