Code solutions to PHP, JS, CSS

Spread your code soluces to the world

Love me

Search results for : in    (10)

Create virtual folders using htaccess (htaccess)

These 3 lines of code for .htaccess create virtual folders. An URL like www.mywebsite.com/virtual_folder/home.html will be understood by the server as www.mywebsite.com/index.php?dir=virtual_folder&page=home
solucior.com/7-Create_virtual_folders_using_htaccess.html

Simple method : listing files from a directory (php)

Here's my simple method for listing files from a directory. In this example I added the natural sort and the file sizes in KB to show how to combine tables and serialized values.
solucior.com/8-Simple_method___listing_files_from_a_directory.html

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...
solucior.com/11-Dynamically_add_rows_to_a_form__Complete_solution.html

Convert unknown text to ISO8859-1 (php)

This method is useful if you get a text field to display in ISO8859-1. In some cases, you do not know if the writer has written characters in UTF8 or ISO. Especially if the text has gone through several transitional stages.
solucior.com/9-Convert_unknown_text_to_ISO8859-1.html

wordwrap without breaking words (php)

A simple function to cut a character string without breaking words. string wrap_word ( string $str [, int $length = 350] )
solucior.com/6-wordwrap_without_breaking_words.html

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.
solucior.com/5-Automatically_adjust_brightness_contrast_of_an_image.html

Move dynamically a DOM objet up (javascript)

When you display elements as list, it is sometimes necessary to provide the classification of the lines. This function can raise an object of a level. Eg. when displaying a list of products. The verification of the nodeType is used to circumvent a problem in some browsers that carriage returns and spaces between two objects as a "objet...
solucior.com/2-Move_dynamically_a_DOM_objet_up.html

Dynamically resizing height of textarea (javascript)

This code dynamically resize a textarea according to its contents. It can work when the textarea gains focus and during typing.
solucior.com/3-Dynamically_resizing_height_of_textarea.html

Show hide DIV content with scrolling (javascript)

Show and hide the contents of a DIV with a single function from a mouse event. The DIV unfolds and folds progressively through the setTimeout. To use this script, run the function deplie() on an event with argument ID of the DIV in question. You can set the DIV position to absolute not to move the below located content.
solucior.com/4-Show_hide_DIV_content_with_scrolling.html

Close HTML tags function (php)

A simple function to close all open HTML tags from text. To be used for example when you propose an editable field with HTML.
solucior.com/1-Close_HTML_tags_function.html