Profile

Achievement

first submission:submitting first snipplet

apphp-snippets's Recent Snippets



This example shows you how to create custom tooltips, using just a pure CSS. In this examples we use "transform" feature of the CSS3 and some other tricks. Also you may find additional tooltip class provided, to show you the way you may customize thi...
0 659 posted 10 years ago by apphp-snippets
This solution will help you to prevent many issues with your site, when you need to prevent long URL's from breaking out of container.
0 735 posted 10 years ago by apphp-snippets
Sometimes you need the page dynamically changes a texbox with a dropdown box. On the example below we show you how to perform this work. The first way demonstrates how to do this with remove() and append() jQuery methods and the second shows how to p...
1 4277 posted 10 years ago by apphp-snippets
Class member encapsulation in JavaScript is very important thing and may be implemented with easy. To define private property or method just use var before the definition or this., if you need to give a public access to property or method.
0 747 posted 10 years ago by apphp-snippets
This code demonstrates a simple way to validate IP address using preg_match() PHP function. This is a very simple code, that allows you to perform this task quickly with a minimum lines of code.
0 785 posted 10 years ago by apphp-snippets
This code demonstrates how to create and parse the JSON data format of using array of PHP. It's a very simple code, that allows you to perform this task.
0 833 posted 10 years ago by apphp-snippets
You can put the user's cursor inside a text box or put focus on select box as soon as your page is loaded. This helps ensure that visitors do not 'overlook' an important form item on your site and this snippet only uses one line of code!
0 611 posted 10 years ago by apphp-snippets
This simple function allows you to getect a country code and city of your site visitors, using the www.geoplugin.net service. You may use this data to add default values in registration form or use it for any other purposes, like blocking access to y...
0 1066 posted 10 years ago by apphp-snippets
Nowadays majority of sites uses the jQuery JavaScript library. A lot of them also make use of Google's hosted version of the library from some reasons: faster loading, better cross site caching etc. However, what if there is ever a problem and jQuery...
0 513 posted 10 years ago by apphp-snippets
Today in the days of high-resolution widescreen displays, it's annoying to visit websites that are formatted like it's 1990's. aligned all the way to the left. Make sure your website doesn't suffer the same fate by forcing it;s content to center hori...
0 664 posted 10 years ago by apphp-snippets
This example shows you how to define custom error pages in .htaccess file and also how to display the error page on your site. You may create separate files for each error, described in Sample 1 or just create the one PHP file for Sample 2. Here...
0 725 posted 10 years ago by apphp-snippets
Lets say you have a table with field called "tags" that consists from tags separated by commas and you want to check whether it includes a required tag. Here the simplest ways of doing that.
0 726 posted 10 years ago by apphp-snippets
Here the simplest way of selecting random rows from the MySQL database with using "ORDER BY RAND()" clause in the query.
0 866 posted 11 years ago by apphp-snippets
File inputs can have an attribute of "multiple" which then allows multiple files to be selected in the file section dialog box. Currently only Firefox 3.6+ and WebKit browsers are supporting it.
0 606 posted 11 years ago by apphp-snippets
This example is a basic design structure for loading multiple video and audio formats for universal work of media content on your page.
1 828 posted 11 years ago by apphp-snippets
This example is a basic HTML5 page structure that you can use for developing of your HTML5 website layout.
0 912 posted 11 years ago by apphp-snippets
This definition allows redirection to the provided URL in 5 seconds. You may set it to 0 if you need an immediate redirect.
0 747 posted 11 years ago by apphp-snippets
Using the same code in different browsers can be displayed in different ways. Resetting styles will help you to avoid such problems.
0 735 posted 11 years ago by apphp-snippets
These 2 techniques can be used for alternating row-colors in a table.
0 727 posted 11 years ago by apphp-snippets
Today with CSS3, you no longer need a background image for gradients. You can use CSS to add a gradient to the background of some elements on your page. For ex.: change the color hex values ("84c8d7" and "327fbd") to the gradient color you need.
1 698 posted 11 years ago by apphp-snippets
This solution is based on Mozilla specific CSS extension. Other browsers will ignore this rule.
0 579 posted 11 years ago by apphp-snippets
This can be used in casting shadows off block-level elements like divs, tables etc. (still not supported in IE7 and IE8). Parameters (from left to right): horizontal offset of the shadow, vertical offset of the shadow, blur radius (optional), spread...
1 637 posted 11 years ago by apphp-snippets
Sometimes it's desirable to change a style of the first and/or last elements in a container. You can do this by manually applying classes to your HTML elements: ("last-child" still not supported in IE8).
0 568 posted 11 years ago by apphp-snippets
This simple scripts show a possibility to call a JavaScript function that retrieves a variable passed from drop down box as a parameter and then the JavaScript redirects the browser to the variable that was passed to it.
0 712 posted 11 years ago by apphp-snippets
This script informs your visitor that a given page may be reached only from the page that you specify. Paste this code before the ending <head> tag on the page:
1 656 posted 11 years ago by apphp-snippets
One of the important things about user input is to verify that the user has supplied the email that you have requested. The function below allows you to verify email address with easy.
1 844 posted 11 years ago by apphp-snippets
The function that closes window is very useful when you use a pop-up window on your page, because it allows the visitor to easily close the window. You can also do it several ways: to use a button, a text link or make the window closes automatically...
1 686 posted 11 years ago by apphp-snippets
You may perform this work with two ways: pass it directly like described in sample #1 or use an anonymous function like its shown in sample #2.
0 927 posted 11 years ago by apphp-snippets
This function allows you to pass two variables that represent ID of two elements on your page. What you click on one of them it hide it and shows another one.
1 550 posted 11 years ago by apphp-snippets
Most today's web browsers like Firefox (Ctrl+D), Opera (Ctrl+T) and IE (Ctrl+D) provide a keyboard shortcuts to enable users bookmark their favorite pages. But if you want to provide your visitors with a "Bookmark this page" link they can click you m...
1 4355 posted 11 years ago by apphp-snippets