Latest Posts

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks

PHP – Best Practises

PHP – Best Practises
There are a number of good practises that you should follow when developing web applications in PHP. Most of these are extremely easy to pick up and some of them will even apply to web application development in general.

1. Redirect after a successful POST request.

This is not PHP-specific. To avoid a situation where the user refreshes their browser and submits the same form data twice, you should always use the Post/Redirect/Get (PRG) pattern. A basic example of this:
Continue to Read »»»

Python

Python

Start python Ubuntu

Ctrl + Alt  + T open Terminal
Type python

>>>   print ("Hellow World")
Hellow World #output

>>> if u exit  Ctrl + D


If you want to create python file

$  gedit  filename.py   (OR)
$  vim    filename.py

Run File

$ python -version filename
 example : $  python3 filename.py




Read more »

PHP merge images example

PHP merge images example

Images













After merging Images









Read more »

DBMS

DBMS
In the 1960s, as vendors began marketing computerized logistics technologies for manufacturing and wider laboratory use, we saw the advent of database management systems (DBMS). DBMSs, or the modern database, allowed users to marshal vast quantities of data. The arduous task of organizing records on the storage medium for optimal access was now handled by a subsystem called the database management system.

Two paradigms emerged, a Hierarchical model typified by IBM’s Information Management System and the ‘Network’ model as epitomized in Charles Bachman's Integrated Data Store. Their respective uses indicate what serious business databases were becoming. The former was developed in conjunction with the Apollo program to catalog the materials needed for the Saturn V moon rocket, and the latter the Apollo Space vehicle as well as General Electric’s manufacturing operations. The business impetus behind the field of data processing had begun to show in evidence: CODASYL (Conference on Data Systems Languages), the largest computing conference of the decade, rather than being composed of academic entities was composed of business enterprises like General Motors and US Steel.


Read more »

Password Protect your local sever folders

Password Protect your local sever folders
 how to secure you folders through .htaccess File.

Password Protect a Folder Through .htaccess

Create one .htaccess file in a folder, which you want to password protected.
Write these codes on .htaccess File
AuthName "Only Authorized Admin"
AuthType basic
AuthUserFile /var/www/example/.htpasswd
require valid-user
AuthUserFile : Defines the the location of .htpasswd from root. This file contains the username and password.
AuthName : It defines the title of popup authentication. So in my case if popup appears, it shows the title Only Authorized Admin.
require valid-user : It means any valid user is allowed.
If i want only specific user then i write their name
 require user suneel

.htpasswd File Creation

Next step is to create .htpasswd file. .htpasswd file contains username and password in the following format.

username: encrypted password
You can use htpasswd generator to create .htpasswd file. Enter username and password. It generate the combination. Paste the generated combination in .htpasswd file.
Now everything is done. Try to open the files in that folder, it will open the popupbox for authentication. If you enter the credential correct, it will allow. Otherwise it will give 401 Unauthorized.
Password Protect Folder
Unauthorized
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn’t understand how to supply the credentials required.
Read more »

Linkedin Direct Message Example

Linkedin Direct Message Example

When logged in user, and provides functionality for sending messages to the connected user .
Open your linkedin see  your  message like bellow picture

You can download the code here
Continue to Read »»»

PHP 5.6.0alpha2 released

PHP 5.6.0alpha2 released
he PHP development team announces the immediate availability of PHP 5.6.0alpha2. This release adds new features and fixes bugs. All users of PHP are encouraged to test this version carefully, and report any bugs in the bug tracking system.

THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!
PHP 5.6.0alpha2 comes with a number of new features, including:documentation
 or you can read the full list of changes in the NEWS file contained in the release archive.
For source downloads of PHP 5.6.0alpha2 please visit the download page. Windows binaries can be found onwindows.php.net/qa/.
Read more »

PHP Memcache in MySQL

PHP Memcache in MySQL

Memcached in MySQL

Many of the caches that already been discussed before have more to do with caching precompiled code for faster execution as well as optimization. Memcached in MySQL is a simple, highly scalable key-based cache that stores data, file and objects wherever dedicated or spare RAM is available for quick access, without needing to parsing or disk I/O. Memcached allows you to take extra, unused memory and make it available to your application that could use extra memory for caching. It also allows you to use memory efficiently that it conglomerates disparate Memcached servers into one memory pool.
In traditional caching systems, memory would be used on each server separately, which was unefficient and wasteful because the capacity of this cache type was only a fraction of what it could be when you sum total of memory across your server farm. Also that way would be complex to keep the data stored in the cache consistent.
Continue to Read »»»

Upload image by using jQuery to display same page without refresh

Upload image by using jQuery to display same page without refresh


Upload image by using jQuery to display same page without refresh

Live Demo     or
Download the source code here..
Continue to Read »»»