Monthly Archives: September 2011

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: ,

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: ,