Augmented reality – 6th Sense – Amazing Video
Posted by Sajith M.R in general on 22. Nov, 2009 | 2 Comments
Watch this amazing presentation. It is really fantastic.
Fancybox runtime height change
Posted by Sajith M.R in php on 20. Nov, 2009 | 8 Comments
For those who use fancy box and iframe inside fancy box might face the issue of changing the height. Once fancybox is loaded with a particular height and width, it does not change when you change the content inside iframe dynamically. Auto height change is only possible for images.
Use the below code to change the [...]
Bootstrapping the startup
Posted by Sajith M.R in php on 16. Nov, 2009 | 1 Comment
I uploaded my first presentation in slideshare. It is about , how the current world’s online technical tools can be used to bootstrap your startup. Most of the services in this presentation are based on UK based startup companies.
Bootstrapping the stratups
View more presentations from sythoos.
Remove emails, numbers or url from text inputs
Posted by Sajith M.R in php on 14. Nov, 2009 | 0 Comments
Below is a simple php code to sanitise an input message . The function has 3 parameters, depending on the parameter the input is parsed to filter.
function sanitize_message( $message , $email = true, $numbers = true, $url = true )
{
$message = strip_tags( $message );
if($email)
{
//strip email address
$email_regexp = “[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,3})”;
$message = ereg_replace($email_regexp, ‘XXX’, $message);
}
if($numbers)
{
//strip all numerical values
$number_regexp [...]
Session/Cookie alone does not secure your web application – CSRF
Posted by Sajith M.R in general on 13. Nov, 2009 | 0 Comments
Guess what will happen if you add an image like below in your html page:
<img src=”http://mail.google.com/mail/?logout&hl=en” />
It does not appear in page, but your google account in another window or another tab will get logoff. Now an external website could logout you from your gmail or orkut.
IF you coded your website to delete a photo [...]
Just a second with Iframe
Posted by Sajith M.R in php on 12. Nov, 2009 | 1 Comment
IF you are facing problem with layout issues inside iframe (which is normally not there in normal pages) just test these things.
Iframe is considered as a separate html page. So it needs all the basic tags, from html, head, body.
It does not get styles from parent, so you need to add manually in the header
Take [...]
Codeigniter – Post resubmit problem on refresh
Posted by Sajith M.R in php on 11. Nov, 2009 | 1 Comment
A small tip for codeigniter programmers.
If you use same controller for display view page and take action on POST, there is a problem may happen when you try to refresh the page after submit, the whole data get re-submit and creates problem.
It can be solved using session. If there is any POST form submit,
ie
if (count($_POST) [...]
Onchange, form submit – Error
Posted by Sajith M.R in html on 10. Nov, 2009 | 0 Comments
If you are facing onchange and form submit of select-box (combo box) in html, you are not alone.
In sometimes onchange = “document.formname.submit()” won’t submit the form, while it works on other html pages.
There is hidden truth of this problem is , there may be some other input having the name “submit”. This cause problem in [...]
Webservice call from PHP – wsdl2php makes it simple
Posted by Sajith M.R in php on 10. Nov, 2009 | 1 Comment
From PHP we usually do a lot of coding to create a webservice client. We use nusoap library for this purpose. But in the case of complex objects, it is very hard to create a soap client call. We need to create a class structure before invoke a wsdl call.
As a solution, you can use [...]
Fancy box
Posted by Sajith M.R in html on 08. Nov, 2009 | 0 Comments
Finally I found a good light-box which really matches the name “Light box” in FancyBox. It is a jQuery based light window. It has very less features while compare with any other light box, but simple to use. Compatible with all browsers.
Go here to find it : http://fancybox.net/
You need to add the below javascript in [...]
Jquery-Mootool Conflict
Posted by Sajith M.R in html on 08. Nov, 2009 | 0 Comments
If you are using mootool and jquery same time in your html pages, it normally won’t work. Because both are using $ variable for the base object. So only the last js file included will be active.
To avoid this, follow the steps:
Include mootool js first
Include jquery js file second
Like this:
<script src=”javascript/mootools-release-1.11.js” type=”text/javascript”></script>
<script src=”javascript/jquery-1.3.2.min.js” type=”text/javascript”></script>
Then [...]


