Recommended:

  • phpclasses.org
  • jsclasses.org
  • jsmag.com
  • siteapps.com
  • View our reviews on Hot Scripts
  • JS Tutorial
  • scripts.com
  • securesignup.com




Recent Comments

Powered by Disqus




Function to create table with specified ASCII symbols

Here is the function, that create table with ASCII symbols from specified ASCII code interval. You can modify it's size and use different styles, onclick function etc. It takes 3 parameters, ID of div element where to attach table, start of ASCII code and end of ASCII code. <div id='chartable'> </div> <script...

Comments Read more

Mysql query cache

There is another mysql related optimization options. It is called query caching. It means, that if you execute completely same queries two times, first one will get results from table, but second one will get results without actually searching the table, from cache of result of the first query. To check if you have query cache enabled,...

Comments Read more

Get movie information from IMDB

This function uses http://www.deanclatworthy.com/imdb/ IMDB API, which parses IMDB files and is updated frequently. It can retrieve array with information about movie taking movie title as parameter: <?php function get_movie_information($name) { $url = "http://www.deanclatworthy.com/imdb/?q=".urlencode($name); // send...

Comments Read more

Form validation PHP and Javascript

There are two very similar in use validation classes, the difference is that one is for javascript: http://www.javascript-coder.com/html-form/javascript-form-validation.phtml and other is for PHP: http://www.html-form-guide.com/php-form/php-form-validation.html So why to use both PHP and javascript validations? Javascript has...

Comments Read more

Select random row faster

Selecting random row from mysql usual way is too slow, especially on tables with a lot of rows, because mysql needs to create temporary table. So never do ti this way: SELECT * FROM table_name ORDER BY RAND() LIMIT 1 It is much better to choose random number in php and then select row with that number. Of course you should know how...

Comments Read more

AJAX suggestion script like in google

Recently I came across one great script that allows you to create suggestions from your database to the user input. More about it here: http://www.robertnyman.com/ajax-suggestions/. We will use this script to implement into form where input fields are dynamically created (user can add more input fields). So to use this script you...

Comments Read more

Indexing mysql tables

There is a way how to optimize mysql query execution time. And that is called index. Indexes help to find rows in tables faster, but it also increase insertion and update time. So it is best to use indexes in tables with a lot of rows and which are usually selected and more rarely updated or new rows inserted. To insert index you need to...

Comments Read more

Select all checkboxes in form

Here is a piece of code that will allow you to select all checkboxes in specified form, like you can do it in your email account  - select all emails. It takes form id as parameter <script type='text/javascript'> function select_allch(id) { var form = document.getElementById(id); var inputs =...

Comments Read more

XSPF web mp3 music player

There is one simple mp3 music player that supports xspf playlists, which can be found here: http://musicplayer.sourceforge.net/. We will modify it, so our songs stay secure and can't be downloaded and also change the text color of player and implement it in website. To keep songs save there are 2 things to be aware...

Comments Read more

Force file download

Here is the function to force open/save dialog and not just automatically open files in browser. You can modify it by adding more file extensions. <?php //$file = "/folder/filename.ext"; function force_download($file) { $ext = explode(".", $file); switch($ext[sizeof($ext)-1]) { case 'jar': $mime =...

Comments Read more

Send UTF8 email with attachment

Here is the function to send email, that can contain UTF8 characters and file attachments. It takes 5 parameters: $to - where to send email, $from - from whom email was sent, $subject - email subject, $message -  message of email, $file - path to file. <?php //$to = "abc@abc.com"; //$from = "admin@web.com"; //$subject = "Welcome to...

Comments Read more

PHP configuration

You can view your PHP configuration using phpinfo() function, but never leave it so others could access it, because PHP configuration contains information, that hackers might find useful. So use it, but so only you can access it. First thing to do is to turn the register_globals off. It is already done in latest PHP versions, but it...

Comments Read more

Lightbox - overlay picture for image galleries

Most popular script for web galleries is Lightbox, it overlays image over the page, thus expanding it for full size view and gives control to move to next or previous picture or close the overlaid picture. And it has an easiest set up. There are to ways to use it: with Prototype Framework and Scriptaculous Effects...

Comments Read more

Google maps API example code

Here is the example code for using Google maps API. You can to get API key for your domain here: http://code.google.com/apis/maps/signup.html Then you can modify code to add functionality with PHP like save locations and map settings to database, etc. <!--Insert your API key instead of text YourAPIkeyHERE--> <script...

Comments Read more

Output buffering

So why should you use output buffering. First of all, because you can send headers any where in the script without worrying, that headers are sent after output, thus eliminating header error. And next thing you can manipulate with content even after all output done and before it was sent to browser. Here is an example of output buffer...

Comments Read more

CKEditor and CKFinder

There is one good combination for every CMS. One allows you to input and edit site content in very user friendly way without HTMl knowledge: http://ckeditor.com/. And the other allows you to manage your files on server: http://ckfinder.com/. But when you combine them together, you get a tool to manage your site content and add/edit...

Comments Read more

Javascript function to check if value is number

Here is the function, that checks if value is numeric. You can edit valid variable to add more symbols, like "." to check for float numbers or add any other allowed symbols. function is_number(val) { var valid = "0123456789"; var number = true; var symbol; for (i = 0; i < val.length && number ==...

Comments Read more

Uploadify with album select

One of the best uploading scripts that I've found is uploadify, which you can get here : http://www.uploadify.com/download/. It allows you to select and upload multiple files. We will use this script with select box to choose to which album to upload photos. We will use uploadify onSelect event to get selected index of drop down box and...

Comments Read more

Javascript tree view

There is one cool javascript tree view script, that is called dtree. You can find it here: http://destroydrop.com/javascripts/tree/. It allows you to create tree view categories like this:  We will implement this into form, so we can submit ID of chosen category, and we will also update tree using jQuery AJAX request. So...

Comments Read more

Suggest your content to other sites

This is not exactly API related thing, just a function that allows to create your content suggestions to other sites like twitter, google buzz and facebook. Of course by modifying you can add more sites. It is also recommended to use url shortening service, because sites like twitter has limited symbols. So code for...

Comments Read more



1 2 3 4 5 6 7 8 9 10 11