All posts by Pramod T P

mcrypt

mcrypt is a replacement for the popular UNIX crypt command. crypt was a file encryption tool that used an algorithm very close to the World War II enigma cipher, which was broken. Mcrypt provides the same functionality but uses several modern algorithms such as AES. Libmcrypt, Mcrypt’s companion, is a library of code which contains the actual encryption functions and provides an easy method for use.

iconv

iconv is a computer program and a standardized API used to convert between different character encodings.

The iconv API is the standard programming interface for converting character strings from one character encoding to another in Unix-like operating systems. Initially appearing on the HP-UX operating system, it was standardized within XPG4 and is part of the Single UNIX Specification (SUS).

 

Hash

A hash function is any algorithm or subroutine that maps large data sets, called keys, to smaller data sets. For example, a single integer can serve as an index to an array (cf. associative array). The values returned by a hash function are called hash values, hash codes, hash sums, checksums or simply hashes.

Hash functions are mostly used to accelerate table lookup or data comparison tasks such as finding items in a database, detecting duplicated or similar records in a large file, finding similar stretches in DNA sequences, and so on.

GD Graphics Library

The GD Graphics Library is a graphics software library by Thomas Boutell and others for dynamically manipulating images. Its native programming language is ANSI C, but it has interfaces for many other programming languages. It can create GIFs, JPEGs, PNGs, and WBMPs. Support for drawing GIFs was dropped in 1999 when Unisys revoked the royalty-free license granted to non-commercial software projects for the LZW compression method used by GIFs. When the Unisys patent expired worldwide on July 7, 2004, GIF support was subsequently re-enabled.

GD is extensively used with PHP, where a modified version supporting additional features is included by default as of PHP 4.3 and was an option before that. As of PHP 5.3, a system version of GD may be used as well, to get the additional features that were previously available only to the bundled version of gd.

mysql functions

Import data into csv – php

<?php
mysql_connect(“localhost”,”root”,”password”);
mysql_select_db(“phpcodez”); // Dont forget to put correct database name
$filename = “users-csv”.date(‘-Y-M-d-D-H-i-s’).”.csv”;
$fp = fopen($filename, ‘w’) or die (‘file cant be opened’);

$fieldsQry = mysql_query(“SHOW COLUMNS FROM user”);
while ($fields = mysql_fetch_assoc($fieldsQry)) {
$fieldNames[] = $fields[‘Field’];
}
fputcsv($fp, $fieldNames);

$usersQry = mysql_query(“SELECT * FROM user”);
while($userInfo=mysql_fetch_assoc($usersQry)){
fputcsv($fp, $userInfo);$i++;
}

system(“chmod 777 $filename”);
fclose($fp);
echo “Imported “.$i.” items”
?>

Read csv file in php

<?php
$filename = str_replace(“.”,date(‘-Y-M-d-D-H-i-s.’),$_FILES[‘upload’][‘name’]);
echo “<table border=’1′>”;
if (($handle = fopen($filename, “r”)) !== FALSE) {
while (($data = fgetcsv($handle, 1000, “,”)) !== FALSE){ ?>
<tr><?php foreach($data as $values) {?><td > <?php echo $values ?></td><?php } ?></tr>
<?php }
}
echo “</table>”;
?>

Opensource

The term open source describes practices in production and development that promote access to the end product’s source materials.Before the term open source became widely adopted, developers and producers used a variety of phrases to describe the concept; open source gained hold with the rise of the Internet.

Open-source software (OSS) is computer software that is available in source code form: the source code and certain other rights normally reserved for copyright holders are provided under a software license that permits users to study, change, improve and at times also to distribute the software.

PHP

PHP is a server side scripting language used in web development to cerate dynamic web pages and can be embedded into HTML codes .The web server with php processor module interprets the code and geneate the web pages as per the given code .

PHP is a loosely typed language. It means you do not have to tell PHP which data type the variable is.PHP automatically converts the variable to the correct data type, depending on its value.

PHP stands for PHP Hypertext Preprocessor (A recursive acronym) .Earlier it was known as personnel home pages .

PHP is an open source software and its free to download and use .

It supports many databases like MySql,Oracle etc…