Nov 30

in emailurile encodate cu quoted-printable apare un caracter “space” care nu poate fi parsat nici de php nici de C#, acesta reprezinta codul “=C2=A0″ in bytes “C2 A0″.

UTF-8 il translateaza in 00A0.

ca sa scapam de acest caracter trebuie sa-l decodam folosind functia “quoted_printable_decode” si apoi sa eliminam sir de caractere “=C2=A0″ sau “\xC2\xA0″

mai multe informatii gasiti aici

Nov 30

One of the best jQuery plugins to display a popup modal window is fancybox

The usage is simple:

$(“.popup”).fancybox();
$.fancybox.resize();

and make sure your link has popup class. It will load the page pointed by your link href and resize as needed.

What if you display a form in the popup and want to reload it with an success message? Use this: $(‘#fancybox-content’).html(data); where data is the content you want to show in popup.

For example, using ajax to submit the form:

$.ajax({
url: ‘exemple.com’,
data: $(‘#form1′).serialize(),
type: ‘post’,
cache: false,
dataType: ‘html’,
success: function (data) {
$(‘#fancybox-content’).html(data);
$.fancybox.resize();
},
error:function (e,data) { alert(e); }
});
Nov 30

How to dynamically create  in PHP a property for an object?

If the object  is $foo you use this syntax: $this->{$property} = ‘a value’;

For example:

<?php

class foo {

public function setProperty($n, $v)
{
   $this->{$n} = $v;
}

}

$foo = new foo();
$foo->setProperty('property1','value1');
echo $foo->property1; //will display value1
?>

Nov 14

Most of the time you get this error (message)  when you ran out of space.

Try “df ” and if “Available” column indicate 0 then try to make some space and issue the command again (vi)

Powered By Wordpress - Theme Provided By Wordpress Theme - Credit Loan