Latest Post
Tampilkan postingan dengan label others. Tampilkan semua postingan
Tampilkan postingan dengan label others. Tampilkan semua postingan

Commonly used abbreviations in php

Written By Unknown on Sabtu, 14 Desember 2013 | 08.43

While working with php or when we talk about php, some abbreviations are more frequently used. I have compiled some most commonly used abbreviations. Here is the list.
    

AJAX => Asynchronous JavaScript And XML
API => Application Programming Interface
ASCII => American Standard Code for Information Interchange
CMS => Content Management System
CSS => Cascading Style Sheet
CGI => Common Gateway Interface
CLI => Command Line Interface
DB => DataBase
DNS => Domain Name System
DOM => Document Object Model
FTP => File Transfer Protocol
GD => Graphics Draw | Gif Draw
HTML => Hypertext Markup Language
HTTP => Hypertext Transfer Protocol
HTTPS => Hypertext Transfer Protocol Secure
IP => Internet Protocol
IIS => Internet Information Services
JS => JavaScript
JSON => JavaScript Object Notation
LAMP => Linux Apache MySQL PHP
MAMP => Macintosh Apache MySQL PHP
MIME => Multipurpose Internet Mail Extensions
OOP => Object Oriented Programming
PCRE => Perl Compatible Regular Expressions
PEAR => PHP Extension and Application Repository
PECL => PHP Extension Community Library
PHP => Hypertext Preprocessor
PDO => PHP Data Objects
POSIX => Portable Operating System Interface
RegEx => Regular Expression
REST => Representational State Transfer
RSS => Really Simple Syndication
SAPI => Server Application Programming Interface
SOAP => Simple Object Access Protocol
SPL => Standard PHP Library
SMTP => Simple Mail Transfer Protocol
SQL => Structured Query Language
INI => INItialization
SEO => Search Engine Optimization
PING => Packet InterNet Groper
SSH => Secure SHell
SSL => Secure Sockets Layer
UCS => Universal Character Set
URI => Uniform Resource Identifier
URL => Uniform Resource Locator
UTF => Unicode Transformation Format
WAMP => Windows Apache MySQL PHP
WWW => World Wide Web
XAMPP => X (any of four different operating systems) Apache MySQL PHP & Perl
XML => eXtensible Markup Language
XML-RPC=> XML Remote Procedure Call
XPATH => XML PATH
XSS => cross Site Scripting


Useful HTACCESS Examples

Written By Unknown on Sabtu, 26 Januari 2013 | 00.44

htaccess is a common file used by several web servers to control configuration for a directory. Using this file we can change the behaviour of the server. This file is used to Rewrite Urls and some other things which is described below.

Create a 404 Error Page

The 404 or Not found error tells that the client didn't get the requested file. And the default error page is displayed. We can create a custom error page using following code in .htaccess file and creating and error page named 404.php in following example.

Create a 404.php file in the root and put the following code in .htaccess file. It will display the customized error page.


ErrorDocument 404 /404.php

Redirect non WWW to WWW



RewriteEngine On
RewriteCond %{HTTP_HOST} example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

Rewrite dynamic urls to look like static urls



RewriteEngine on
RewriteRule ^product-([^/]+).\html$ product.php?type=$1
RewriteRule ^user/([^/]+)$ users.php?name=$1

The output of above rewrite examples will be

http://example.com/product-car.html
http://example.com/user/altaf 

Allow or Deny specific IP Addresses



order allow,deny
deny from 122.16.219.88
deny from 168.35.210.15
allow from all

Allow or deny specific IP Addresses using above code. Put your list of IP Addresses as given above.

Cache files using htaccess



<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=31449600, public"
</FilesMatch>

Set an expiration for cache files using above code.

Disable directory listing using htacess

Directory listing may be a potential security risk on your site. When you enter any address of a directory into the browsers address bar, all files and folders af that directory are listed by default. To prevent this listing you can put a small piece of code in .htaccess file as follows.


Options -Indexes

HTTP status codes and its meaning

Written By Unknown on Kamis, 22 Maret 2012 | 08.21

HTTP status codes are the codes that the Web server uses to communicate with the Web browser or user agent.

Here is a list of HTTP status codes that might be returned:



1xx: Information

100 Continue
101 Switching Protocols
103 Checkpoint

2xx: Successful

200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content

3xx: Redirection

300 Multiple Choices
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
305 Use Proxy
306 (Unused)
307 Temporary Redirect

4xx: Client Error

400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URI Too Long
415 Unsupported Media Type
416 Requested Range Not Satisfiable
417 Expectation Failed

5xx: Server Error

500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported


Of the above the most common HTTP status codes are



200 OK
301 Moved Permanently
403 Forbidden
404 Not Found
500 Internal Server Error

Url Rewriting with .htaccess file

Written By Unknown on Senin, 13 Juni 2011 | 03.53

Now, Its time to clean up our url. It is very important to have keywords in the url so that search engines can tackle them easily. Further Rewriting urls makes it more readable and it looks very clean.

We can rewrite our urls using .htaccess file. So let us start with

What is .htaccess file?

It is a common file used by several web servers to control configuration for a directory. Also known as hypertextaccess. It is an extremely sensitive file.

A missing semi colon, incorrect letter or an extra backslash can mess everything up. So, be careful while working with this file.

To achieve this we have to follow these steps :
 
1. Create a .htaccess file. Save this file in root directory.
2. Enable the RewriteEngine with this code

        RewriteEngine on
 
3. Now define RewriteRule for the configuration

       RewriteRule ^product-([^/]+)\.html$ product.php?category=$1

Syntax : RewriteRule INPUTURL OUTPUTURL [FLAGS]

 RewriteEngine on
RewriteRule ^product-([^/]+).\html$ product.php?category=$1


Above code will result following url -

Original Url    : http://example.com/product.php?category=car
After Rewriting : http://example.com/product-car.html

We can also make our urls look like directories as follows.
 
 RewriteEngine on
RewriteRule ^product/([^/]+).\html$ product.php?category=$1


Wait... One thing to note : Always use absolute paths for your links while dealing with directory type url rewriting.

Add hit counter to your website

Written By Unknown on Minggu, 01 Mei 2011 | 23.43

Hello friends. To add a hit counter on your website or webpage visit one of the following links.

You can customize your counter as per your need. Copy generated code and paste into your webpage.

Add favicon to your website

Written By Unknown on Sabtu, 30 April 2011 | 00.06

Favicon is a small icon basically of 16x16 pixels displayed on your browser's address bar. It is the acronym for Favourite icon. Adding a favicon to a website or webpage is very easy. To do so first create a small icon of size 16x16.

You can create favicon of your image from
http://tools.dynamicdrive.com/favicon/

Just add this code into your webpage's head section.



<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">

How to setup a cronjob in your cPanel

Written By Unknown on Jumat, 21 Januari 2011 | 21.14

A cronjob is a command or task which is to be executed automatically at a certain time. Cronjob is a very useful tool when you want to run some scripts  automatically.

To setup a cronjob follow the steps.

1. Log into your cPanel.

2. Find the Cron jobs icon in advanced section. Click it and follow steps.

3. Enter an email address ( the cron output will be sent to this email )

4. Setup the time when the script to be executed.

5. Enter the full path to your script to be executed like

  php /home/[username]/public_html/send_mail.php


6. Click on the 'Add New Cron Job' button

Change [username] with your username and the path of your php script (send_mail.php) in above syntax.

If you have filled the Cron email box, An email will be sent when the cronjob runs. Or you can leave it blank if you dont want any email
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger