Javascript to validate Email Address

Javascript Phone Input Mask

Use the following code snippet to apply Javascript input mask for the ten digit Phone number:

Less Popular Python Modules That Every Programmer Should Know

Every popular general-purpose programming language has a fully-featured, well-organized standard library that helps programmers use pre-developed functions or classes to boost their coding productivity. Some programming languages offer pre-imported objects or functions to access the standard library, i.e., JavaScript. Meanwhile, some languages provide separate importable […]

Play Youtube Videos Continuously

Also for MP4 videos:

Simple steps to setup git repo on remote web server and sync it with local workstation

Get string between two strings using PHP

PHP Bot or Crawler Detection Functions

Get List of Files in an Array Using PHP Given Path or Directory

Download textarea contents as a file using Javascript

Source: https://stackoverflow.com/questions/609530/download-textarea-contents-as-a-file-using-only-javascript-no-server-side

MySQL Select Row With Most Recent Date Per User

PHP MySQL Date Formats

PHP Date Comparison Checks Using strtotime Function

PHP date comparison examples:

Dates Difference In Days Using PHP

Go to top of page link

Find Earth Coordinates (Latitudes, Longitudes) distance using PHP

Align Checkboxes and Radio Buttons CSS

jQuery Mouse Hover Effect

jQuery Loop Class

MySQL Update Column From Another Table Based On Where Clause

Open Link URL In New Tab Using Javascript

PHP Extract Number From String: Integer Or Float

Application-Wide PHP Error Detection Utility

jQuery Datepicker restrict second date based on first

MySQL Decimals

Decimals can be added to a MySQL database by using the DECIMAL(M,D) data type. This requires 2 arguments. M is the maximum number of digits, ranging from 1 to 65. D is the number of decimal places available, ranging from 0 to 30. Note that […]

Print This Page – Hide Print Button

MySQL – Delete Duplicate Rows Keeping Latest

PHP Remote File Exists

Timezones List in PHP

CSS to show or hide content on particular devices based on width

Xcode Swift code to create a WebView for iOS devices

Simple steps to follow on the link below:

Bootstrap swipe for mobile devices

Note: No need of any JS library besides native jQuery only.

Youtube & Google Map Responsive using Bootstrap

Youtube: Google Map:

Total execution time in PHP

Simple Detect Device Type using PHP & Javascript

PHP: Javascript:

MySQL date to PHP date format

PHP Date Format List

Embed youtube video with modest branding and no info

Get file date time stamp using PHP in MySQL format

PHP Function to get alphabetical list of subdirectories

PHP function to get alphabetical list of subdirectories in a given directory

PHP Function To Get Alphabetical List Of Subdirectory

PHP function to get alphabetical list of subdirectori in a given subdirectory

PHP Function To Generate Image Thumbnail

Following is a PHP function to generate thumbnails for JPEGs and PNGs. You may use the function by sending the image location, thumb location and the needed width.

SEO friendly change address bar link using Javascript

Change is SEO friendly: https://moz.com/blog/create-crawlable-link-friendly-ajax-websites-using-pushstate

PHP Simple Image Crop

WordPress admin add featured image upload capability to the theme

Add the following code to functions.php of the theme: add_action( ‘after_setup_theme’, ‘ja_theme_setup’ ); function ja_theme_setup() { add_theme_support( ‘post-thumbnails’); }

HTML Checkbox And Javascript jQuery – Different Scenarios With Examples

For Reference: Window, Document & Screen Width and Height

Hidden file upload with button and file select count

Hidden file upload with button and file select count

HTML meta tag for redirection

We can use the following piece of code to redirect to a page using meta tag:

Set page title and meta description dynamically using Javascript

Set page title and meta description dynamically using Javascript:

Set php.ini Max Size & Time Limits with Apache .htaccess

Set php.ini Max Size & Time Limits with Apache .htaccess in the application folder:

Right Click Menu

Code showing Right Click Menu using JavaScript & jQuery

PHP and Javascript – Check Substring in String

Following php code checks to find substring in string: 1. Simple Case 2. Check if a string contains a word from an array 3. Check if a string contains all words in an array Javascript:

Engraved and Embossed Text Using HTML & CSS

Contact Form Using PHP

Eyedropper to get HEX color code using mouse pointer

Following code shows Eyedropper to get HEX color code using mouse pointer:

Plain CSS and Javascript Tabs

Following code demonstrates plain CSS and Javascript tabs:

Date/Time Stamp – JavaScript to MySQL format

JavaScript code showing to convert date/time stamp from JavaScript to MySQL:

Simple & Draggable Image Popups Using jQuery

The following code shows how to implement simple draggable image popups using jQuery:

JQuery UI Drag and Drop with Drag Element ID

The following code shows drag and drop feature of the jQueryUI and also collects the DOM Id of the element dragged.

Fly HTML Element From One Position To Another using jQuery

Following code demonstrates flying one div to to another div using jQuery

Placeholder complete example link

Following is a complete example link for Placeholder.com, showing: image size, format, text and foreground and background colours. http://via.placeholder.com/300×200/4372AA/ffffff.jpeg?text=GTAWDs+are+Awesome

Trigger JavaScript after set time of window or tab focus

Following code shows how to trigger JavaScript code after a specified time interval when getting back to windows or tab of the browser:

Responsive Image Maps

Following code shows how to make image maps responsive.

Offset an HTML anchor to adjust for fixed header

Following code shows how to offset HTML anchor to adjust for fixed header. So that the link jumps to to the exact location of the page with fixed header. Considering that the height of the header is about 150 pixels.

HTML5 – Usage of details and summary tags

Following code shows usage of the details and summary tags that are introduced in HTML5.

jQuery Multiselect Checkboxes And Dropdown

Following codes shows how to implement a set of multiselect checkboxes with a dropdown using jQuery and Bootstrap: Method: Simple Using jQuery Classes Method: In A Dropdown Method: Bootstrap Multiselect Plugin Using Select Tag The code uses a bootstrap-multiselect plugin. The function showValues() builds a […]

Loop through checkboxes with a class using jQuery

Following code shows how to loop through checkboxes with a given class using jQuery to get the values of checkboxes that are checked.

Jquery Blink Text Effect

Following code shows text blinking three times using jQuery and then it stops blinking. You may increase or decrease the count and timing by changing the variables.

Bootstrap Tabs

Following code shows a simple implementation of tabs using Bootstrap having three tabs and contents respectively: Notice active tab is used to show default content.

Trigger JavaScript on Active Browser Window or Tab

Following code triggers JavaScript on active browser window or tab:

Editable Dropdown – HTML5

Editable dropdown in HTML5:

Rich Text Editor – CKEditor Simple Usage

Download CKEditor Library and use the following code to implement simple rich text editor with the following formatting capabilities: – Bold – Italic – Underline – Bullets – Numbering

Playing Audio on Web Pages

Method 1: HTML5 Audio Tag Method 2: Javascript

Bootstrap Carousel Code

Following is the piece of code that can be used to implement Bootstrap Carousel with indicators showing at the bottom of the carousel. It’s also adaptive for mobile devices.

Filter from different Youtube links for the same video using PHP

For different purposes there are a number of Youtube links for the same video. For example: embed, showing related, autoplay etc variations of video links. Following is a piece of PHP code that helps you filter from different Youtube links for the same video: Also […]

Apache .htaccess http redirect to https

Following piece of code can be used in a .htaccess file to direct any http request on port 80 to be directed to https for seamless https access: WordPress:

JavaScript Drag Div

Following is the plain (Vanilla) JavaScript code with which we can drag an HTML div tag:

Stripe Payment API – Create Monthly Subscription Plan, Create Customer & Assign Customer to the Plan

Stripe API request and response code to create monthly subscription plan, create customer and assign customer to the plan to be charged every month, posted by stripe checkout.js Please check the comments within the code for better understanding. In case you run into any problems […]

PHP File Download Script

The following piece of PHP code can be used to download a file from a web server: Usage: 1. Save the above code in download.php 2. Use it as: http://example.com/download.php?filename=file.csv

Click Images As Radio Buttons

Following piece of code lets users click on images to serve as radio buttons:

Show Mouse Coordinates On Drag or Mouse Down & Move

Following is a small piece of code that shows mouse coordinates when you drag the mouse using jQuery:

Simple File Upload Using PHP, AJAX With jQuery

Following is one the simplest versions of file upload example using PHP, AJAX with jQuery: So, first thing first, the front-end part, consisting of HTML interface and JavaScript, upload.html: The back-end part, consisting of file upload logic in PHP, upload.php: That’s it! To download the […]

Using Apache – Secure a website or a particular subdirectory

Using Apache to secure a website or a particular subdirectory: 1. Create a password .htpasswd file on the webserver containing username and password (or a sub directory if you want security on a particular sub directory only). 2. Create .htaccess file in the sub directory […]

Youtube Javascript API – Basic Example

The following example illustrates the basic controls of the Youtube Javascript API to Play/Pause and Stop the videos:

Copy To Clipboard Javascript

The Javascript code allows programmers to create buttons that can copy the code to clipboard. The content of the div with the id toCopy is copied to the clipboard. To download the clipboard code click on the following link: Download

HTML select and optgroup tags building using PHP and MySQL

Following is piece of code that shows HTML select and optgroup tags building using PHP and MySQL. The following example is based of the database structure in OpenCart. Also, it is assumed that the select tags are already part of existing HTML. And sample result […]

OSCommerce & OpenCart Attributes SQL

SQL query shows the relationship between different attribute tables: SELECT agd.name AS group_name, ad.attribute_id, ad.name AS attribute_name FROM oc_attribute_description ad JOIN oc_attribute a ON ad.attribute_id = a.attribute_id JOIN oc_attribute_group_description agd ON agd.attribute_group_id = a.attribute_group_id ORDER BY group_name, attribute_name For example: group_name attribute_name Color Black Color […]

Crop-Circle using jQuery

Crop-Circle is an image cropping tool which helps the end users crop rectangular images into circles using drag and drop. It works with desktops, tablets, iPads and cellphones. It uses jQuery that provides a cropping interface. It works with desktops, tablets, iPads and cellphones. To […]