This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Tampilkan postingan dengan label php. Tampilkan semua postingan
Tampilkan postingan dengan label php. Tampilkan semua postingan

Senin, 10 Januari 2011

PHP fsockopen failed when accessing through IPV6



When i try creating xml-rpc based application using php. It show that it cannot get 200 status.
Then i try ping localhost through command prompt. It's a suprise then, the ping result is IPV6 which is ::1: for localhost.

I try to nonactivate IPV6 localhost in window/system32/drivers/etc/hosts and remark ipv6 address. Then I try to ping again, it result 127.0.0.1 then amazingly, my xml-rpc application is working.

My Computer is Vista, i think it just a matter turn off ipv6 so ping will always return ipv4 address.

i am trying xml-rpc using : codeigniter xml-rpc,incutio

Senin, 20 Desember 2010

PHP CLI : PHPRC


When i look at to phpinfo() in cli mode. it's seems php automatically read such php.ini from defined location. and when i look to environment variables there is such variable called PHPRC, which values is directory/folder of where php.ini reside.


Rabu, 24 November 2010

CakePHP Swf object

http://bakery.cakephp.org/articles/alkemann/2008/11/25/flashhelper-a-wrapper-for-the-swfobject-js-class


Examples

<div id="flashy"><p>No flash loaded</p></div>
<?php echo $flash->renderSwf('test.swf',400,200,'flashy');?><?php
$flash
->init(array('width'=>200,'height'=>100));
echo
$flash->renderSwf('test1.swf');
echo
$flash->renderSwf('test12swf');
?><?php
echo $flash->renderSwf('fl_countdown_v3_3.swf?mo=1&da=24&snd=off&co=AA3333',800,250,false,array('params' => array('movie'=>'?mo=1&da=24&snd=off&co=AA3333')));
?>

Links

  1. http://code.google.com/p/swfobject/
  2. http://code.google.com/p/swfobject/downloads/detail?name=swfobject_2_1.zip
  3. http://code.google.com/p/swfobject/wiki/documentation
  4. http://code.google.com/p/alkemann/issues/entry

Kamis, 28 Oktober 2010

PHP win32 Service

<?php


if ($argv[1] == 'run')

{

win32_start_service_ctrl_dispatcher('dummyphp1');

while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message())

{

# do your work here.

# try not to take up more than 30 seconds before going around the loop

# again

sleep(10);

}

}


if($argv[1]=="register")

{

win32_create_service(array(

'service' => 'dummyphp1', # the name of your service

'display' => 'sample dummy PHP service #1', # description

'params' => 'd:\w32service.php run', # path to the script and parameters

));

}

else if($argv[1]=="unregister"){

win32_delete_service('dummyphp1');

}

else

{

echo "dummy Service\n";

echo "-----------------------------------\n";

echo "register - register this service \n";

echo "unregister - unregister this service \n";

echo "run - run this service \n";

}

?>

Jumat, 01 Oktober 2010

Solved : message: Cannot open user default database. Using master database instead



Error message: Cannot open user default database. Using master database instead.

this mean user that used to access database don't have default database set in it's property.
Open MsSQL Server Management Studio->Security->Logins->user->properties you will get this dialog, then make sure you have default database selected fot he user.



php draft printing

  • A standard receipt printer such as the Epson TM-T88III receipt printer uses the parallel port.
  • To print to the parallel-port receipt printer, you print through port PRN (exactly the same as printing from DOS prompt).
  • From within PHP-GTK2, you need to first establish the connection with the printer by using $handle = fopen("PRN", "w");
  • Thereafter, to print anything to the printer, you just "write" to it like the file handle: fwrite($handle, 'text to printer');
  • There are newer receipt printer that uses USB. I believe you should be able to print to such printers through PRN too.

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More