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




Adding CRON Job to your Cpanel

If you need to delete temporary files once in a while, or you want to perform database backups on a regular bases, you can do that using cron jobs. What cron job do is simply access your script or perform specified command in a specified period of time.  You've probably already noticed Cron job section in your hosting Cpanel or...

Comments Read more

Meta tag usage in nowadays search engines

Should you use meta tags now, when most search engines just parse your page and get all information from there? Does any of the search engines even look at meta tags? Here are couple of reasons why you should use meta tags: Meta tags suggest keywords to search engines, so if you have many words on your site that are not related to...

Comments Read more

Get all guitar chord variations

Here is a function that can get all guitar chord variations using chord name. It uses http://pargitaru.id.lv/api/ API, which can give chord information based on chord names, modifications like major, minor, etc, or any string and fret combination. This function takes chord name as a parameter, you can specify chord modification - minor,...

Comments Read more

Submit your sitemap to Google, Yahoo, Ask, Bing and Moreover

Here is a function that allows you easily submit your sitemap to search engines and services like Google, Yahoo, Ask, Bing and Moreover with passing just one parameter, your sitemap URL. Then you'll have a response array, which you can us to check if there any connection related curl errors, or submitting related error responses, or...

Comments Read more

Multiple curl requests

Here is function that performs multiple curl requests which is much faster then file_get_contents or single curl request. For more information http://webcodingeasy.com/Site-optimization/Comparing-filegetcontents-with-curl-and-curl-multi-handlers It takes array of URLs to request as a parameter and returns array of contents or errors...

Comments Read more

strpos function for arrays

Here is a function that checks if any of array values is a substring of a specified string. It takes string as haystack and array of needles and returns false if none of needles appeared in haystack or key of array of first needle that appeared in string: <?php function strpos_arr($haystack, $arr_needle){ $valid = false; ...

Comments Read more

Generate sitemap for your site

Here is a function to generate sitemap by parsing your page URLs. Note: use it only locally, for example, it takes 3-4 seconds to generate a sitemap for http://webcodingeasy.com locally, but it takes about 100 seconds to do it remotely. <?php //setting to no time limit, set_time_limit(0); //Placed locally on server it takes...

Comments Read more

Comparing file_get_contents with curl and curl multi handlers

There is a way to handle multiple HTTP requests using curl. For comparison we will request contents of same url 100 times  and for that we will use 3 different codes, one for file_get_contants, other for simple curl request and last for curl_multi request handling. Here is a file_get_contents function: <?php $domain =...

Comments Read more

Tracking your site statistics

How to determine if your site is search friendly, or did search optimization provide any boost in your search rankings? Most popular search engines already provide you with tools to track your site appearance in search engines. You'll need to create 3 accounts to access webmaster tools in 3 biggest search engines Google, Yahoo and Bing....

Comments Read more

What to use dashes or underscore?

What separator to use when separating words in URLs? Should you use underscores like this: "word1_word2" or dashes like this: "word1-word1". Well I think underscore looks more awesome than dashes. But it's not about a taste or how it looks. It's about how search engines work. If you search for...

Comments Read more

Using MOD rewrite to make site search friendly

Here is the way to rewrite your site URLs to more search friendly way. For example address http://example.com/index.php?category=5&subcategory=1 doesn't say anything to search engines nor to site visitors. Much better way is rewriting URL as a path like http://example.com/category-name/subcategory-name. It tells search engines and...

Comments Read more

Making database backup and storing it in file

Here are two useful function, one makes a backup of specified database and stores it in file, other restores database from a backup file made by first function. <?php //backup function to create database backups files //$con - database connection //$db - database name //$path - path where to save backup file //$sep - custom seperator...

Comments Read more

Get list of episodes from IMDB

Here is the piece of code that will get a list of episodes for TV series from this unofficial IMDB API. This function takes TV series name as a parameter and you may also specify year, if there are more TV series with same name. It returns an array with all episodes of specified TV series structured by seasons: <?php //name - title of...

Comments Read more

PHP easter eggs

There is an easter egg in PHP configuration that also allows you to detect a possible vulnerability. Inside the php source within php-source/ext/standard/info.h (lines 53 to 56), there are 4 code defining PHP logos like this: <?php #define PHP_LOGO_GUID "PHPE9568F34-D428-11d2-A769-00AA001ACF42" #define PHP_EGG_LOGO_GUID...

Comments Read more

Strip slashes based on magic_quotes settings

Here is a function that checks magic_quotes and then accordingly strips slashes in your text. It can be used to clean text before using mysql_real_escape string, if you can't disable magic_quotes. Or just clean text after taking it out of database: <?php function strip($val) { if (TRUE ==...

Comments Read more

Emulate register_globals off

Here is a function that emulates register_globals off, if you can't disable it yourself, you can use this function in the beginning of the script: <?php // Emulate register_globals off function unregister_GLOBALS() { if (!ini_get('register_globals')) { return; } // Might want to change this perhaps to a...

Comments Read more

Generate QR code with meta data

Here is a simple function to generate Quick Response codes with simple meta data like text, phone number, email or URL. This function takes 5 parameters: data to encode, type of meta, data to use(TXT for text, EMAIL for email, TEL for phone number and URL for a website link ), size of image in pixels, error correction level,...

Comments Read more

Simulating table sorting using li elements

It is hard to find good script to sort table cells using drag and drop combined with ajax. So here is an example where you can simulate table cell sorting using floating li elements with specified width and limiting them with container div element. You'll need http://webcodingeasy.com/js/mootools.js to make it work. <?php $con =...

Comments Read more

Make first letter of every sentence uppercase

This function takes text as a parameter and makes first letter of every sentence to the uppercase. You can modify it, to make all string lowercase before making first letter uppercase (if you have whole text in CAPS for example). <?php function sentence_case($string) { //find sentence $sentences = preg_split('/([.?!]+)/',...

Comments Read more

Don't use index.php or index.html

Don't use index.php or other common file names like home.php or welcome.php to access your site. Of course in depends on your server security, but there are many scripts that are searching files with these names and tries to delete them. It is much better to give file a custom name, maybe depending on your site name. And then to make it...

Comments Read more



1 2 3 4 5 6 7 8 9 10 11