From The Blog

PHP: check string has HTML tags

25 November 2012, in

you may think as the best way to check a string has HTML tags is to check the string after stripping tags:

if( strlen($string) != strlen(strip_tags($string)) ){

echo 'Contains HTML tags';

}

But, the best way is to use regular expressions:

if (preg_match("/([\<])([^\>]{1,})*([\>])/i", $string )) {
echo 'Contains HTML tags';
}



Post a Comment

Flash objects overlay problem

15 February 2012, in

How to make flash objects overlaid by another html elements?

simply by using the wmode attribute and set it to transparent

wmode - Possible values: window, direct, opaque, transparent, gpu. Sets the Window Mode property of the SWF file for transparency, layering, positioning, and rendering in the browser. If this attribute is omitted, the default value is "window". For more information, see Using Window Mode (wmode) values below.



Post a Comment

SWF flash files ignore stacking order, play on top of DHTML layers

14 February 2012, in

Issue

A SWF file in a layer on a DHTML page containing several layers displays above all the layers regardless of the layers' stacking order ("z-index").

Solution

Use the WMODE parameter to allow layering of rich media content with DHTML layers. The WMODE parameter can be "window" (default), "opaque," or "transparent." Using a WMODE value of opaque or transparent prevents a SWF file from playing in the topmost layer. And, it allows you to adjust the layering of the movie within other layers of the HTML document.



Post a Comment

Don't put a form inside a table

2 February 2012, in

Don't put a form inside a table, instead put table inside form

Wrong approach:

<table>

<form id="form-id" method="POST" action"action.php">

<tr><td><!--  form inputs --> </td></tr>

</form>

</table>

 

Correct approach:

        <form id="form-id" method="POST" action"action.php">

<table>

<tr><td><!--  form inputs --> </td></tr>

</table>

</form>



Post a Comment