AdBrite

Friday, September 10, 2010

How to enable cUrl in PHP

You have to do the below things to enable the curl in you PHP.

Find the php.ini file
If it is installed directly it will be available in your
C:\php or C:\Program Files\PHP folder
If it is installed by xampp it will be available in
C:\Program Files\xampp\apache\bin\ or
C:\Program Files\xampp\php\ or
C:\Program Files\xampp\php\php4\

Add the extension=php_curl.dll if not exist in the php.inc file
of remove the comment ; of extension=php_curl.dll

Add the php_curl.dll file in PHP\ext folder if it is not exist.

Restart your apache server.

check the cURL is installed / not by using phpinfo();

Cheers

Wednesday, September 1, 2010

Enable OpenSSL Support for PHP on Windows

As a prerequisite, two libraries must be existing in your Windows system:libeay32.dll and ssleay32.dll. Two ways to achieve this:

Download and Install the Openssl available from the blow url.
http://www.openssl.org/related/binaries.html OR copy these two files to C:\WINDOWS\system32 folder. They’re shipped with PHP package, you can find them in PHP root folder

open php.ini by using any text editor, and remove the semicolon before the following line:

extension=php_openssl.dll

Double check it, and try phpinfo() to see what's output of your PHP

Wednesday, February 20, 2008

Sorting with leading articles in My Sql

Sorting with articles in My Sql.
When you are required to sort your list alphabetically like listed below
(Note: 'The' is leading some title but not considered in sorting)


Dual Alibi
Duane Hopwood
Dubarry
Dubeat-E-O
The Duchess and the Dirtwater Fox
The Duchess of Duke Street
The Duchess of Idaho
Duck Season
Duck Soup
DuckTales the Movie: Treasure of the Lost Lamp
The Dude Bandit
Dude Ranger


Use the following query to generate results as sorted like above

SELECT m.title,
CASE WHEN SUBSTRING( m.title, 1, 4 ) = 'The '
THEN SUBSTRING( m.title, 5, LENGTH( title ) -4 )
WHEN SUBSTRING( m.title, 1, 3 ) = 'An '
THEN SUBSTRING( m.title, 4, LENGTH( title ) -3 )
WHEN SUBSTRING( m.title, 1, 2 ) = 'A '
THEN SUBSTRING( m.title, 3, LENGTH( title ) -2 )
ELSE title
END AS TempTitle
FROM movies m
WHERE < your logic >
ORDER BY TempTitle


The above query is resulting you with leading articles in the title field, and
without leading articles (The,An,A) in the field TempTitle so you can order by Asc or Desc your TempTitle and show the Title

I hope It will be solve your issue when sorting needed like this way.
(Thanks to our Tech Mr.Varadha)


Thursday, November 29, 2007

PHP

PHP is a reflective programming language originally designed for producing dynamic web pages. PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses. PHP is a recursive initialism for PHP: Hypertext Preprocessor .The main implementation is produced by The PHP Group and released under the PHP License. This implementation serves to define a de facto standard for PHP, as there is no formal specification. The most recent version of PHP is 5.2.5, released on 9 November 2007. It is considered to be free software by the Free Software Foundation.