Blog Archives

Converting Letter Case in php/MySql

Sometimes we might be in need to convert the output results in upper case or lower case format MySQL comes up with a solution for that where you can use LCASE and UCASE to convert the results into any one format completely. LCASE can

Posted in MySQL Tagged with: ,

Remove a text from a textbox when the it is focused

Webpage should be designed such that the elements/controls occupy less space in any webpage for improving user-friendliness, especially in Home page of any website. This can be achieved in many different ways. One way is instead of displaying the Labels

Posted in General, Html Tagged with: ,

PHP code for listing files in a Folder

If you want to list all the files in a folder for some purpose here is a php code for that .You can use this below code to list all the files in a folder

Posted in Php Tagged with: ,

Setting UserAgent for php curl session to avoid 500 Internal Server Error

We are using below function for getting webpage content using curl module of php. function getmethod_request($ch,$ckfile,$urlValue) { curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile); //The name of the file containing the cookie data. The cookie file can be in Netscape format, or just plain

Posted in Php Tagged with: ,

Parsing webpage using php DOM

PHP is having DOM functionality for parsing webpage by considering the HTML content of the webpage as XML data. If you assign the $data with the HTML content of the webpage, below code will load the HTML content in DOM

Posted in Php

Removing Last Character in a String

In PHP, we will be requiring to remove the last Character from a string variable. For example, consider below query. select * from employees where employee_id in (1,2,5,7) Assume that the employee_id values 1,2,5,7 should be dynamically collected from a

Posted in MySQL, Php Tagged with: ,

Javascript code for changing list box (select tag) value based on change in another listbox

Javascript can be effectively used for dynamically changing value in one drop down list (i-e select/option tag) when a value in another related drop-down list is changed. Assume that a webpage is having list of names in one drop-down list

Posted in Javascript Tagged with: ,

Email syntax validation using javascript

We should validate the syntax of email entered in the form in the client side itself to save unnecessary server process to validate the email. It can be done using javascript. Consider below form. onSubmit event of Form is calling a

Posted in Javascript Tagged with: ,

PHP function to get the ID generated from the previous INSERT operation in mysql

It is necessary to get the ID (auto increment field) of a row inserted into a mysql table if the table is having any parent-child relationship with one or more child tables. For example, assume that we are entering questions

Posted in MySQL, Php Tagged with: ,