Mantis bug tracker is free web based bug tracking system.
This software needs php,apche server or iis and mysql.
This software code was written in php.
To run this sofware we should have basic knowledge in php, server and mysql.
You can see all information in the following website. http://www.mantisbt.org/
A Very first version of php is PHP/F1 at 1995 its called Personal Home Page Tools' set of script ,next version of php 2.0 was released at 1997 somewhat more future and several peoples used it, after very short period they released PHP 3(1998) ,Its new version with more function so its called differently compare to PHP2.0 that is recursive acronym – PHP: Hypertext Preprocessor.
After small interval they released PHP4 in 1999 with wide range of additional new features and more no of developers PHP 5 was released in July 2004 after long development PHP is open source general-purpose scripting language with embed In HTML coding ,Its used to develop a dynamic WebPages with added new API packages
Example
First Application
echo "Hi, First PHP script Example. . . . ";
?>
In PHP Scripting Start’s and End’s with
Variable Declaration
In PHP Variables are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive
Example
$Val=’String’;
$Val1=24;
?>
Here variable $val,$val1
Global Variable Declaration
In PHP Global Variable Different from other language, if u can access global variable means you must declare with in the function only
Example
$value=’one’;
function Fn_test()
{
global $value;
$value=’Two’;
}
Fn_test();
echo $value;
?>
Here output is Two only ,because in function Fn_test take the global value Two only
Mysql Database Connection in sample coding For PHP
$host=”Localhost”;
$user=”test”;
$pass=”Invdb”;
/* Connecting, selecting database */
$Conn = mysql_connect($host, $user, $pass)
or die("Could not connect");
mysql_select_db("DatabaseName") or die("Check your Database");
/* SQL Operation Here Select, Insert and others */
/* Closing connection */
mysql_close($Conn);
?>
PHP: Hypertext Preprocessor(PHP) is open source Scripting Language suited for Web development .
Here i give some date format and some PHP Programming hints
1. Date Format from DD/MM/YYYY to change YYYY/MM/DD
Input Billdate= DD/MM/YYYY
Code: $BillDate=substr($BillDate, 6, 4)."/".substr($BillDate,3, 2) ."/".substr($BillDate, 0, 2);
Output YYYY/MM/DD
2. Date Format from YYYY/MM/DD to change DD/MM/YYYY
Input $tody="YYYY/MM/DD"
Code: if(empty($tody)) { } elseif(!ereg("^([0-9]{4})/([0-9]{2})/([0-9]{2})$",$tody, $parts)) {
// Check the format echo "Error Message";
}
$BillDate="$parts[3]-$parts[2]-$parts[1]";
Output DD/MM/YYYY
3.Format a number
input : $Netamt=125045
Code : number_format($Netamt, 2, '.', '');
output: 1250.45
input : $Netamt=125045
Code : number_format($Netamt, 3, '.', '');
output: 125.045
4. File Writing Concept In PHP
File open with write mode , so here mansion that w, R for read,A for append.
$Bill="Bill.txt";
$fd=fopen($Bill,"w");
fwrite($fd,"\nSlNo\t". " RATE\t"."MATERIAL NAME\t\t"."QUANTITY"." AMOUNT\n");
fwrite($fd," 1 ". " 250.00 "."Carbon Rod"."25"." 6250.00\n");
fclose($fd);
Output File(Bill.txt):
SlN RATE MATERIAL NAME QUANTITY AMOUNT
1 250.00 Carbon Rod 25 6250.00
5.Wordwrap in php
Word wrap is used to wrapped string at the specified column first argument is input string and second argument is character Limit
$Word_val= wordwrap($input_value, 25, "\n"); // Here 25 character spacing
echo "".$Word_value."";
Here goes the simple database connectivity procedure.
$ref = mysql_connect("localhost","username","password");
if(!$ref)
{
die("Could not connect to the database",mysql_error());
}
else
{
//user operations like selection of databses,insert query,update query,etc....
}