Code solutions to PHP, JS, CSS

Spread your code soluces to the world

Love me

Search results for : form    (10)

Isolate a color (php gd image)

Here is a class to isolate a primary color rendering of a photo black and white. The choice of using Object-oriented programming instead of a function gives the advantage to add filters or other image effects thereafter. Instantiation [code]$obj = new image_effect(); // Optional : ratio size of the working image. default : 2 ...

Display a date in French (php)

Function gdhfr for "Groupe Date Heure France" shows the date and time in the french format. mixed gdhfr ( int $timestamp = time() [, bool $hm = false [ , bool $s = false ] ] ) $timestamp = UNIX time $hm = when set to TRUE, displays hours and minutes $s = when set to TRUE, displays seconds

Rotate and scale with CSS (css)

Here are two examples of rotation and scale (zoom) with CSS3. The first example uses javascript to apply transition effects by changing the CSS class of an element. This allows the event to be deported to another area. The second example works with the simplest pseudo-class HOVER. The effects do not work with Firefox for now only on...

Image class resize and rounded mask (php gd image)

This PHP GD class offers several useful features. It resizes images, apply a rounded mask with various options : • output size • crop mode : crop to fill, fill to fit • rounded corners or square • color of the rounded mask It is complete and usable in all cases. This class use the PNG mask round_440.png

Infinite zoom CSS3 and Javascript (css)

Here is an example of the use of CSS3 with scale. Update : Added compatibility with Opera 11

Javascript opacity (javascript)

Here is the method the most compatible to change the CSS opacity of an element with javascript. [code]opacity // modern browser -moz-opacity // older versions based on firefox -khtml-opacity // older versions based on Konkeror and Safari filter: alpha(opacity) // Internet Explorer before 8.0 ...

Dynamically add rows to a form. Complete solution (php)

Here is a complete solution for adding rows to a form. This sample script displays a form for insert and update products. When clicking on the link [+], we add a new product line. It also includes the update by sending the "mod" parameter corresponding to the ID of the MySQL table row to edit. Dynamic system for adding rows : Initially, the...

Adjust the rate of image colors (php gd image)

This script adjusts the amount of colors in a jpg, gif or png picture. By modifying the value $variant between -25 and 15, you get a picture more or less colorful. Original picture

Zoom with CSS3 (css)

CSS3 allows the function of "scaling"(or zoom) on an HTML element. In the example below, the scale is assigned to the pseudo class : hover. Syntax : transition: (transition-property) (transition-duration in secondes) (transition-timing-function) • transition-property : all, css property • transition-duration : timing...

Automatically adjust brightness contrast of an image (php gd image)

This script adjusts the brightness and contrast of an image using PHP5 and the GD2 library. Set the variable $url_img with the path of your initial image. You can change the variable  which corresponds to the size of the working image of the script.