Author Archives: Admin

list all sub service settings varible into the ccp screen

usually package will display only one item(First settings variable- subservice field/variable in the package)  into the ccp

But we can display all variable into the subservice in ccp. for this use the following steps

1)go to  applications tab.
2)click on the application
3)click on Resource Types tab.
4)select the main resource type created.
5)Click on activation parameters tab.
6)click on Services link
7)Click on subservice edit option and select the apropriate check box for the variable

How to compress an image using imagemagick in PHP?

(first instal imagemagick into the server, then it will set the path as follows)

$imagemagicpath=’usr/bin’ //usualy this is the path for image magick

$source=’images/first.jpg’;

//first.jpg is renamed to converted.jpg
//Specifying destination path

$destination=’images/converted.jpg’;

//path for imagemagic function
//specify quality here
$cmd=$imagemagicpath.”/convert “.$source.” -quality 10% “.$destination;

//above line is executing here
exec($cmd);

this will reduce the image quality to 10%
for example first.jpg is initially 120kb it will reduced to 12 kb.

How to use Stored Procedures in PHP

see this simple example

To calculate the area of a circle with given radius R, the following commands can be given

delimiter //
create function Area (R double) returns double
deterministic
begin
declare A double;
set A = R * R * pi();
return A;
end
//
delimiter ;

And to call it from php code to display the area of a circle with radius 22cm,
<?
$rs_area = mysql_query(“select Area(22)”);
$area = mysql_result($rs_area,0,0);
echo “The area of the circle with radius 22cm is ”.$area.” sq.cm”;
?>