dummy text generator

Categories: tool

Tags: generator, lorem, radom text, tool

need some dummy / random text as content prototypes but don’t want to use text like ‘content here’ or ‘blah blah blah’? very often you see dummy text beginning with ‘Lorem ipsum…’.

try this lorem ipsum generator to generate paragraphs and lists of text. the site also explains that it’s not a random text but taken from a latin literature.


browser compatibililty

Categories: css, tool, bookmark, browser, free

Tags: browser, compatibility, css, tool, web design

even though there are standards, some browsers still like to use their own standard, like … IE (surprise!?) – different versions of IE will also render your site differently.

in addition, there are million browsers and platforms out there. you can’t install everything nor have all those platforms to check your website compatibility.

to check what your site look like in other browsers and platforms, use this tool to ensure your site is more or less consistent or not too far out. note: be patient, it may take a while to get screenshots.


php: increase memory limit

Categories: php, unix, apache2

Tags: memory, php

errors like ‘allowed memory size of x bytes exhausted’ or ‘zero size reply’ usually means there’s not enough memory allocated for php. you need to increase the value.

if you have admin access, you can edit /etc/php.ini, locate and update ‘memory_limit’ to values like 16M, 32M, 64M. this change is global to the system. restart apache after update.

if not, add this in php script:

PHP:

ini_set("memory_limit""32M");

php: function with variable parameters

Categories: php

Tags: function, parameter, php

to define a function that takes any number of parameters, eg

PHP:

foo(); // no parameter
foo("a"); // 1 parameter
foo("a""b""c"); // more than 1 parameters

to access the parameters passed to a function, use these php functions:

PHP:

function foo() {
   for ($i 0$i func_num_args(); $i++) {
        echo "$i:" func_get_arg($i);
   }
}

alternative way to access the parameters:

PHP:

function foo() {
   foreach (func_get_args() as $i => $arg) {
        echo "$i:" $arg;
   }
}

xajax and radio buttons

Categories: html, ajax

Tags: radio, xajax

to display a group of choices to select-only-one as radio buttons, the name and id parameters must be the same for all <input>.

the html code:

Code:

<input type="radio" name="option" id="option" value="1" onclick="xajax_click(this.value);" checked />option 1<br />
<input type="radio" name="option" id="option" value="2" onclick="xajax_click(this.value);" />option 2<br />
<input type="radio" name="option" id="option" value="3" onclick="xajax_click(this.value);"/>option 3<br />

to pass the value of radio button to xajax function, use this.value. not this.checked, as the value is always true when it’s clicked.

the xajax function:

PHP:

function click($value) {
    $x = new xajaxResponse();
    switch ($value) {
    case 1:
        //do something
        break;
    case 2:
        //do something
        break;
    case 3:
        //do something
        break;
    }
}

1 2 3 4 5 6 7 8 9 10 11 ... 16 »