PHP, Javascript, CSS & mySQL code snippets

This section of our website contains public source code snippets in a variety of languages which are free to use. Snippets include single lines of code to whole functions and classes.

advertisement

Selecting the minimum value
in mysql
 

Selecting the minimum value of the field in the brackets.

Select code

 

Selecting the maximum value
in mysql
 

Selecting the maxmimum value of the column in the brackets.

Select code

 

Check array is associative
in php
 

PHP is_assoc_array function to check if given array is associative or not

Select code

 

Convert a string to upper/lower case
in vb6
 

Convert a string to either upper or lower case with the LCase and UCase functions

Select code

 

Disable text box
in vb6
 

Disable text box on commandButton click. Be sure to update the control names to make it work!

Select code

 

Check file exists
in vb6
 

A Visual Basic 6 code snippet to check if a given file name exists

Select code

 

Current page URL
in javascript
 

Get the current title of the page using javascript and store it into a variable

Select code

 

Page title
in javascript
 

Get the current title of the page using javascript and store it into a variable

Select code

 

Close window
in javascript
 

Attempts to close the current window. Good idea for popups

Select code

 

Back button
in javascript
 

Allows you to take a user to the previous page they were on using a button

Select code

 

 
Tips & advice

Need coding help? Tips, tricks or advice? Check out our webmaster forums

advertisement