The Blog

Author: admin

Time to move into PHP Framework

Posted on

Few of mine ecommerce client started to outgrow the ecommerce that I custom made for them. They’re into tens of thousands of orders and some sales reps have few hundred ship to addresses, things are no longer working well since concept of paging was not included in my original code and it feels like it’s too much work to individually try to think of all the areas where drop down menus or pages shows thousands of records that renders them useless.

So I’m going to try to recreate what I got for them in one of the available PHP framework. So far I’m looking at CodeIgniter, Symphony2 or Yii.

Idea is to create something that I can reuse for all those clients and also to create something that I can use just as a CMS for my other clients.

Main objective is scalability, security and future easy of expending, something that I’m missing in my current way of doing things.

Posted in PHP Leave a comment

Slick way to deal with 301 and 302 from Ajax call.

Posted on

On the Server side response with similar code:

header('HTTP/1.0 278 Ok');
echo json_encode(array('redirect' => "/"));
exit;

In JQuery bind AjaxSuccess to this function. Somewhere in a global header or layout page, so it get accesses from all pages.

$('body').bind('ajaxSuccess',function(event, request, settings){
if (request.status == 278){
jsonresponse = $.parseJSON(request.responseText);
$('form').dirtyForms('setClean');
window.location.href = jsonresponse.redirect;
}
});
Posted in PHP Leave a comment
« Previous PageNext Page »