Free Android CakePHP GMaps Articles by Bali Web Design

March 6, 2012

How to set confirmation email order prestashop

Filed under: prestashop — admin @ 3:36 am

By default prestashop will not send confirmation email order to sales or admin email. So we need to set first before we can get confirmation email order using prestashop. We know prestashop is quit complex CMS for ecommerce, that make setting much harder than others CMS.

I use this procedure to get confirmation email order send to sales or admin email :

  1. Install Maill Alerts by Prestashop Module, and then configure. Place target confirmation email address on Send to these e-mail addresses
  2. Go to Employess > Contacts, set email for Customer Service
  3. Go to Preferences > E-mail, set email to Customer Service

By using that procedure my prestashop now can send confirmation email order to sales or admin email.

February 13, 2012

How to enable and disable PHPSESSID

Filed under: php-tips-basic — admin @ 10:13 pm

For some case where the visitor cannot save cookie, we need to put it on the url. This is happen on some browser also that cannot save cookie, like i-mode in japan. It will be a big task to add PHPSESSID to all pages URL, so we can enable PHPSESSID using php script setting.

ini_set('session.use_cookies', 0);
ini_set('session.use_only_cookies', 0);
ini_set('session.use_trans_sid', 1);
ini_set('', 'PHPSESSID');
ini_set('url_rewriter.tags', 'a=href,area=href,frame=src,input=src,form=,fieldset=');


January 29, 2012

How to add first column on existing table mysql

Filed under: query tips — admin @ 11:42 pm

I am encountering problem to add increment column on existing table mysql database. The existing table has some columns except increment column. So now i need increment column, but i don’t want to put this column at the end of the table, this is not look good for me.

So i check to mysql manual and found interesting sintak, beside use AFTER column syntax, there is FIRST syntax. So the query is look like this


I hope this article can help you to add first column on existing table mysql database server.

May 25, 2011

Saving Mysql Function Now on Cakephp

Filed under: cakephp,php — admin @ 3:45 am

I think many cakephp programmer will get confuse when they want to save column/field on table with mysql function such as NOW(), CURDATE(), etc, We cannot use simple way of the saveField method or save method on model object.

This code will not save the data field into current date time on mysql.

$this->ModelName->saveField('date_field', 'NOW()');


$data['ModelName']['id'] = 1;
$data['ModelName']['date_field'] = 'NOW()';

It will not work as you want. Because cakephp will ada quote on the value.


January 31, 2011

debug certificate expired android problem

Filed under: android,java — admin @ 2:18 am

I got this error message on my android projects after upgrading eclipse and android sdk manager. But it probably not the thing that makes this problem. So i explored about this problem on google and found the solution, at least this is work for my eclipse.

I am using windows Vista, here are my step to solve debug certificate expired android problem :

  1. Delete debug.keystore on C:\Users\{USER_PROFILE}\.android folder. For others operating system, you could check the path on eclipse. Please open menu Preferences – Android – Build – Default debug keystore.
  2. On eclipse, Clean the projects ( Menu Projects > Clean ). You probably need to restart your eclipse.

I figure out this problem are because the certificate is expired. I wondering if this debug keystore is same as keystore that i create when i installing the Android SDK. I don’t know, but eclipse can generate it. It seem the certificate is expired in 365 days. I hope this article can help to solve this problem.

January 19, 2011

strange id added on form create url cakephp

Filed under: cakephp,php — admin @ 9:18 pm

I found something strange on cakephp when i create form using FormHelper, a strange id appear on the action url. So i have this code on my view

<?php echo $form->create('Evoucher', array('url' => array('controller' => 'gift_vouchers', 'action' => 'buy', $giftVoucher['GiftVoucher']['amount'])));?>

It is generated a form tag with strange id added on action url. Something like this

<form id="EvoucherBuyForm" method="post" action="/gift_vouchers/buy/2/20" accept-charset="utf-8">

After exploration, i found the problem was on the controller action for buy. I have set id for the data variable

$this->data['Evoucher']['id'] = 2;

So after taking out this line, i change it into

$this->Evoucher->id = 2;

And cakephp can generate correct action url for the form tag

<form id="EvoucherBuyForm" method="post" action="/gift_vouchers/buy/20" accept-charset="utf-8">

I hope this tutorial help you. Thanks for visiting our blog

November 8, 2010

How to install cakephp on hostgator shared hosting

Filed under: cakephp,php — admin @ 8:03 pm

I just buy new shared hosting account for my new domain on hostgator. I want to install cakephp web application into this hosting. However the local setting or common setting that i used on other hosting is not work on hostgator. After figure out the problem, i found that the hostgator hosting does not allow for changing DOCUMENT ROOT setting.

So after research on cakephp tutorial, which come to setting cakephp on shared hosting and i think this solution also good for production phase. I will mention how i set my cakephp on hostgator (more…)

October 28, 2010

How to remove generator meta tag wordpress

Filed under: php,wordpress — admin @ 10:13 pm

Starting from wordpress 2.5 and above, you cannot remove generated meta tag wordpress version through your template. On prior version, it is simple by comment the line for showing wordpress version on your template.

<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />

WordPress 2.5 and above, the version is moved into the core of the wordpress. So it will automatically generate metatag generate, such as

<meta name="generator" content="WordPress 3.0" />

If you want to remove this generated line, there are some ways :

  1. Login to administration wordpress page, and then go to Appearance > Themes, And then Editor. Open functions.php, Add this line before the closing ?> tag
    remove_action('wp_head', 'wp_generator');
  2. Or use this plugin. Install on plugins area.

Redirect with exit using cakephp

Filed under: cakephp,php — admin @ 8:38 am

If you run redirect function on cakephp 1.1, don’t forget to add exit() function after redirect sintax. This thing can make security hole that confusing you. The purpose of adding exit() function after redirect sintax is to avoid php running others code after redirect function.


However cakephp 1.2 give you default exit after redirect. The complete sintax for redirect on cakephp 1.2 is

$this->redirect('controller/action', null, true);

which the third parameter define exit = true, means terminate the script. second parameter is for setting exit status, for example 404, etc. Defaultly you only need to write


get referer url using cakephp

Filed under: cakephp,php — admin @ 8:08 am

Sometime we need to get the referer url that access a page or url on our website. It is easy to find referer url using cakephp framework. Inside your controller or cakephp class, you can get the referer url using this sintak


Referer url is the last page or url that accessed by the user before open current page or url.

« Older PostsNewer Posts »