Showing 12 Result(s)

Generate random password string with Javascript

Generate a random password for a website or javascript application. Include following script to your application and call function randomPassword() There are various ways to call randomPassword() function within this script. you can test output for this function by calling function with console log. Default random password with default configuration console.log(‘Default : ‘, randomPassword()); Password …

Detecting request type in PHP

For detecting request type in PHP we can use variable $_SERVER by using $_SERVER[‘REQUEST_METHOD’]. $_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server. Following methods can be detected with key ‘REQUEST_METHOD’: GET POST PUT DELETE Example:

How To Reset MySQL Auto Increment Column

MySQL database provides a beautiful feature of Auto Increment Column index. Database table can define its primary key as Auto Increment number and MySQL will take care of its unique value while inserting new rows. Each time you add a new row, MySQL increments the value automatically and persist it to table. But sometime you …

What is a WordPress Theme Text Domain ?

In this example ‘my-theme-textdomain’ is the defined as textdomain for the Theme. Text Domain is used to make the Theme translatable. (Codex reference: load_theme_textdomain()). Define the Theme’s textdomain load_theme_textdomain( 'my-theme-textdomain', TEMPLATEPATH.'/languages' ); Define translatable strings in the template. This is done using one of a few translation functions: __() (for returned strings), _e() (for echoed strings), and _x()/_ex() …

Setting up new hostname with WordPress database

For setting up new hostname with WordPress database is required while moving site to new hostname. For this following SQL commands. In following example we are moving site with hostname to hostname