Zymic

Webmaster resources

Follow us on Twitter!

Hosting status updates - Click here

PHP & MySQL

Free Tutorials » PHP & MySQL » Creating your own PHP functions

A function in its simplest form is a set of instructions. Learn the basics in this tutorial.

Step 1

What is a function? A function in its simplest form is a set of instructions. We call it (usually feeding data into it at the same time), and it either outputs something, performs an action or returns the result of the instructions to the script. Most of the time we use PHP's built in functions, such as md5(), explode(), preg_match()etc. But sometimes it is useful for us to create our own functions to use in the same way we do the built in functions. A function has several basic parts:

  • The identifier, this is the "name" of the function, and it is the keyword required to call the function where it is required. This can me something like myfunction, in which case the function would be called with myfunction().
  • The parameters, these are the arguments the function takes when it is called, and are listed from left to right as first, second, third parameters. For example, the function myfunction($foo,$bar) has two parameters, $foo and $bar. $foo is the first, and $bar the second.
  • The body of the function, this contains the statements that the function executes when it is called. These can be anything you wish depending on the purpose of the function.

Step 2

Why use them? User-defined Functions are a very important part of coding any sizable application, they allow the coder to write less code, and makes changes to one part of a complex program much faster and more effectively than with basic procedural code. The main reason for this is that it allows you to re-use the code that you have already written, for example, say you have an operation that takes ten lines of code to achieve each time it's called, by making this code a seperate entity and using it every time those statements are required you avoid repetition of code and thereby reduce the total number of lines more and more drastically the more times the function is required.

Step 3

To create functions we use the keyword "function". This keyword tells the PHP engine that the next block of code will be a custom function. After this we name the function, then add the parameters in brackets and then define the content of the function within curly braces. Here is an example of a custom function:

<?php
 
// array randarr(int $num [, int $min=0 [, int $max=100 ]])
//
// Create an array of integers between
// a minimum and maximum value.
function randarr($num,$min=0,$max=100) // Define the function.
{
   // The code within these curly braces is the body of the function.
   $arr = array(); // Create an array.
   for($i=0; $i < $num; $i++)
      $arr[] = rand($min,$max); // Add $num integers to the array.
   return $arr; // Return the array created.
   // End of function.
}
 
?>

Step 4

Calling functions: In this example we have made a function that creates an array of random numbers, we can then call the function with randarr(), the name of the function. For example, if we saved the above code in a file called funcs.php then we might call it like so:

<?php
 
require_once('funcs.php'); // Include our randarr() function
 
$array = randarr(5,50,80); // Create an array with five integers between 50 and 80.
print_r($array); // Output our array.
 
/*
Outputs something like this:
Array
(
    [0] => 66
    [1] => 74
    [2] => 62
    [3] => 52
    [4] => 69
)
*/
 
?>

Step 5

Optional Parameters: In many cases we do not want to define all of the parameters every time we execute the function, and to facilitate this we use optional parameters. To create an optional parameter we simply assign the parameters a default value when we declare the function using the = (equals) operator. In randarr the second two parameters ($min and $max) are optional parameters, and the function can be called without them. If we wanted the function to use our default range of 0-100 then we would call the function like this:

<?php
 
require_once('funcs.php'); // Include our randarr() function
 
$array = randarr(5); // Create an array with five integers within our default range (0-100).
print_r($array); // Output our array.
 
/*
Outputs something like this:
Array
(
    [0] => 46
    [1] => 38
    [2] => 79
    [3] => 56
    [4] => 97
)
*/
 
?>

We could also call the function with only one of the optional parameters, but the first parameter is required every time you call the function. Attempts to call it without non-optional parameters will cause an error. As you can see, by placing that function in another file and using require_once() to include it into other pages we can create these arrays in two lines instead of the four it would take otherwise.

Step 6

Applications of Functions: You can apply functions to larger applications too. For example, you may require a library of common functions for a web application, and place them all in one globally included file, or extend functions into class methods with Object-Oriented coding. Once you understand functions many long and previously complex programs become simple to write and maintain. And that's all you need to know about functions :-)

Tutorial comments

15.04.2013 -

Roll1950 says …

nice

28.03.2013 -

ramadanz-0-9 says …

VBRQ

21.03.2013 -

sultanooo says …



function envFlush(a){function b(c){for(var d in a)c[d]=a[d];}if(window.requireLazy){requireLazy(['Env'],b);}else{Env=window.Env||{};b(Env);}}envFlush({"ffid1":"AcGk41pUaoubhwxb-lKFQkCaG1TC-fLLoZP7Xp4YHhtOhNoB-4908ffGeHZwzB77IP8","ffid2":"AcF3mwhxTy7QeN6jidnHuS36zPEOwPL4Hx3NuqnuScPfkLVnpRsI7c4xmdvD1T_Lukg","ffid3":"AcGRHsLd7QvTuYyaN7jP5lrHpAMuvIyzav-gT20ucg46iV79L4PTgY20ZfAa0P-JrkbOmVxtb3sE_40oWgmskzFd","ffid4":"AcFevlaZZJNa1G2vFIQOfsa7ugQ4EuEajPYRI3lZSJf47SthfTFxVylfh95_zVQyAtE","ffver":63083,"recaptcha_focus_on_load":"false","recaptcha_lang":"\"en\"","user":"0","locale":"ar_AR","rtl":true,"method":"GET","svn_rev":762572,"tier":"","push_phase":"V3","pkg_cohort":"EXP1:DEFAULT","vip":"31.13.80.23","www_base":"http:\/\/www.facebook.com\/","rep_lag":2,"fb_dtsg":"AQDMIDP-","ajaxpipe_token":"AXgxMj1BtX2QixoE","lhsh":"XAQHUIc3u","tracking_domain":"https:\/\/pixel.facebook.com","retry_ajax_on_network_error":"1","fbid_emoticons":"1"});envFlush({"eagleEyeConfig":{"seed":"0VKf"}});CavalryLogger=false;ظ…ط±ط­ط¨ط§ظ‹ ط¨ظƒ ظپظٹ ظپظٹط³ ط¨ظˆظƒ - ظ‚ظ… ط¨طھط³ط¬ظٹظ„ ط§ظ„ط¯ط®ظˆظ„ ط£ظˆ ط¨ط§ظ„طھط³ط¬ظٹظ„ ط£ظˆ ط¨ظ…ط¹ط±ظپط© ط§ظ„ظ…ط²ظٹط¯






window.Bootloader && Bootloader.done(["9UrUm"]);new (require("ServerJS"))().handle({"require":[["removeArrayReduce"],["markJSEnabled"],["lowerDomain"],["QuicklingPrelude"],["Primer"]]})ط´ط¹ط§ط± ظپظٹط³ ط¨ظˆظƒط§ظ„ط¨ط±ظٹط¯ ط§ظ„ط¥ظ„ظƒطھط±ظˆظ†ظٹ ط£ظˆ ط§ظ„ظ‡ط§طھظپظƒظ„ظ…ط© ط§ظ„ط³ط±ط§ظ„ط¨ظ‚ط§ط، ظ…طھظ‘طµظ„ط§ظ‹ظ‡ظ„ ظ†ط³ظٹطھ ظƒظ„ظ…ط© ط§ظ„ط³ط±طںâ€ژRECENT LOGINSâ€ژظٹط³ط§ط¹ط¯ظƒ ظپظٹط³ ط¨ظˆظƒ ط¹ظ„ظ‰ ط§ظ„طھظˆط§طµظ„ ظˆط§ظ„طھط´ط§ط±ظƒ ظ…ط¹ ظƒظ„ ط§ظ„ط£ط´ط®ط§طµ ظپظٹ ط­ظٹط§طھظƒ.ط§ظ„طھط³ط¬ظٹظ„ظ…ط¬ط§ظ†ظٹطŒ ظˆط³ظٹط¨ظ‚ظ‰ ظ…ط¬ط§ظ†ظٹ ط¯ط§ط¦ظ…ط§ظ‹.ط¥ظ† Javascript ظ…ط¹ط·ظ„ ظپظٹ ط§ظ„ظ…طھطµظپط­ ظ„ط¯ظٹظƒ.ظٹط±ط¬ظ‰ طھظپط¹ظٹظ„ JavaScript ظپظٹ ط§ظ„ظ…طھطµظپط­ ظ„ط¯ظٹظƒ ط£ظˆ ط§ظ„طھط±ظ‚ظٹط© ط¥ظ„ظ‰ ظ…طھطµظپط­ ظ…ظ…ظƒظ‘ظ† ظ„ظ€ JavaScript ظ„ظ„طھط³ط¬ظٹظ„ ظپظٹ ظپظٹط³ ط¨ظˆظƒ.طھط§ط±ظٹط® ط§ظ„ظ…ظٹظ„ط§ط¯: ط§ظ„ظٹظˆظ…:12345678910111213141516171819202122232425262728293031 ط§ظ„ط´ظ‡ط±:ظٹظ†ط§ظٹط±ظپط¨ط±ط§ظٹط±ظ…ط§ط±ط³ط£ط¨ط±ظٹظ„ظ…ط§ظٹظˆظٹظˆظ†ظٹظˆظٹظˆظ„ظٹظˆط£ط؛ط³ط·ط³ط³ط¨طھظ…ط¨ط±ط£ظƒطھظˆط¨ط±ظ†ظˆظپظ…ط¨ط±ط¯ظٹط³ظ…ط¨ط± ط§ظ„ط³ظ†ط©:2013201220112010200920082007200620052004200320022001200019991998199719961995199419931992199119901989198819871986198519841983198219811980197919781977197619751974197319721971197019691968196719661965196419631962196119601959195819571956195519541953195219511950194919481947194619451944194319421941194019391938193719361935193419331932193119301929192819271926192519241923192219211920191919181917191619151914191319121911191019091908190719061905ظ„ظ…ظژ ط¹ظ„ظٹظ‘ ط¥ط¯ط®ط§ظ„ طھط§ط±ظٹط® ظ…ظٹظ„ط§ط¯ظٹطںط£ظ†ط«ظ‰ط°ظƒط±ط¨ط§ظ„ط¶ط؛ط· ط¹ظ„ظ‰ ط§ظ„طھط³ط¬ظٹظ„طŒ طھظˆط§ظپظ‚ ط¹ظ„ظ‰ â€ڈط´ط±ظˆط·ظ†ط§â€ڈ ظˆط£ظ†ظƒ ظ‚ط±ط£طھ â€ڈط³ظٹط§ط³ط© ط§ط³طھط®ط¯ط§ظ… ط§ظ„ط¨ظٹط§ظ†ط§طھâ€ڈ ظ„ط¯ظٹظ†ط§طŒ ط¨ظ…ط§ ظپظٹ ط°ظ„ظƒ â€ڈط§ط³طھط®ط¯ط§ظ… ظ…ظ„ظپط§طھ طھط¹ط±ظٹظپ ط§ظ„ط§ط±طھط¨ط§ط·â€ڈ.ط§ظ„طھط³ط¬ظٹظ„ط§ظ„ط§ط®طھط¨ط§ط± ط§ظ„ط£ظ…ظ†ظٹظ‡ط°ط§ ط§ظ„ط­ظ‚ظ„ ظ…ط·ظ„ظˆط¨.ط£ط¯ط®ظ„ ط§ظ„ظƒظ„ظ…طھظٹظ† ط£ط¯ظ†ط§ظ‡طŒ ظ…ظپطµظˆظ„طھظٹظ† ط¨ظ…ط³ط§ظپط©.ظ„ط§ ظٹظ…ظƒظ†ظƒ ظ‚ط±ط§ط،ط© ط§ظ„ظƒظ„ظ…ط§طھ ط£ط³ظپظ„ظ‡طں â€ڈط¬ط±ظ‘ط¨ ظƒظ„ظ…ط§طھ ط£ط®ط±ظ‰â€ڈ ط£ظˆ â€ڈط§ظ„طھط³ط¬ظٹظ„ ط§ظ„طµظˆطھظٹâ€ڈ.ظٹط±ط¬ظ‰ ط¥ط¯ط®ط§ظ„ ط§ظ„ظƒظ„ظ…ط§طھ ط£ظˆ ط§ظ„ط£ط±ظ‚ط§ظ… ط§ظ„طھظٹ طھط³ظ…ط¹ظ‡ط§.â€ڈط¬ط±ظ‘ط¨ ظƒظ„ظ…ط§طھ ط£ط®ط±ظ‰â€ڈ ط£ظˆ â€ڈط¹ظˆط¯ط© ط¥ظ„ظ‰ ط§ظ„ظ†طµâ€ڈ.ط¬ط§ط±ظٹ ط§ظ„طھط­ظ…ظٹظ„...ظٹط±ط¬ظ‰ ظƒطھط§ط¨ط© ط§ظ„ظ†طµ ظپظٹ ط§ظ„ظ…ط±ط¨ط¹:ظ…ط§ ظ‡ط°ط§طںط§ظ„ط§ط®طھط¨ط§ط± ط§ظ„ط£ظ…ظ†ظٹظ‡ط°ط§ ط§ط®طھط¨ط§ط± ط£ظ…ط§ظ† ظ‚ظٹط§ط³ظٹ ظ†ط³طھط®ط¯ظ…ظ‡ ظ„ظ…ظ†ط¹ ظ…ط±ط³ظ„ظٹ ط§ظ„ط¨ط±ظٹط¯ ط§ظ„ط¹ط´ظˆط§ط¦ظٹ ظ…ظ† ط¥ظ†ط´ط§ط، ط­ط³ط§ط¨ط§طھ ظ…ط²ظٹظ‘ظپط© ظˆط¥ط±ط³ط§ظ„ ط±ط³ط§ط¦ظ„ ط¨ط±ظٹط¯ ط¹ط´ظˆط§ط¦ظٹ ط¥ظ„ظ‰ ط§ظ„ظ…ط³طھط®ط¯ظ…ظٹظ†. آ  ط¹ظˆط¯ط©ط¬ط§ط±ظٹ ط§ظ„طھط³ط¬ظٹظ„...ط­ط¯ط« ط®ط·ط£طŒ ظٹط±ط¬ظ‰ ط§ظ„ظ…ط­ط§ظˆظ„ط© ظ…ط±ط© ط£ط®ط±ظ‰.ط¨ط§ظ„ط¶ط؛ط· ط¹ظ„ظ‰ طھط³ط¬ظٹظ„طŒ طھط¤ظƒط¯ ط£ظ†ظƒ ظ‚ط±ط£طھ ظˆظˆط§ظپظ‚طھ ط¹ظ„ظ‰ â€ڈط´ط±ظˆط· ط§ظ„ط§ط³طھط®ط¯ط§ظ…â€ڈ ظˆâ€ڈط³ظٹط§ط³ط© ط§ظ„ط®طµظˆطµظٹط©â€ڈ.â€ڈط¥ظ†ط´ط§ط، طµظپط­ط©â€ڈ ظ„ظپط±ظ‚ ظ…ظˆط³ظٹظ‚ظٹط© ط£ظˆ ظ…ط´ط§ظ‡ظٹط± ط£ظˆ ط´ط±ظƒط§طھ.ط§ظ„ط¹ط±ط¨ظٹط©English (US)Espaأ±olPortuguأھs (Brasil)Franأ§ais (France)DeutschItalianoहà¤؟नà¥چदीن¸­و–‡(简ن½“)و—¥وœ¬èھ‍...ط§ظ„ظ‡ط§طھظپ ط§ظ„ظ…ط­ظ…ظˆظ„ط§ظ„ط¨ط­ط« ط¹ظ† ط£طµط¯ظ‚ط§ط،ط§ظ„ط´ط§ط±ط§طھط£ط´ط®ط§طµط§ظ„طµظپط­ط§طھط£ظ…ط§ظƒظ†ط§ظ„طھط·ط¨ظٹظ‚ط§طھط§ظ„ط£ظ„ط¹ط§ط¨ظ…ظˆط³ظٹظ‚ظ‰ط­ظˆظ„ ظپظٹط³ ط¨ظˆظƒط¥ظ†ط´ط§ط، ط¥ط¹ظ„ط§ظ†ط¥ظ†ط´ط§ط، طµظپط­ط©ط§ظ„ظ…ط·ظˆظ‘ط±ظˆظ†ط§ظ„ظ…ظ‡ظ†ط§ظ„ط®طµظˆطµظٹط©ظ…ظ„ظپط§طھ طھط¹ط±ظٹظپ ط§ظ„ط§ط±طھط¨ط§ط·ط§طھط§ظ„ط´ط±ظˆط·ط§ظ„ظ…ط³ط§ط¹ط¯ط© Facebook آ© 2013 آ· ط§ظ„ط¹ط±ط¨ظٹط©/*=0){throw 1;}}si_cj("3 ");}catch(e){si_cj("1 \t");window.document.write("\u003Cstyle>body * {display:none !important;}\u003C\/style>\u003Ca href=\"#\" onclick=\"top.location.href=window.location.href\" style=\"display:block !important;padding:10px\">\u003Ci class=\"img sp_dac3l4 sx_2e5c4c\" style=\"display:block !important\">\u003C\/i>\u0627\u0644\u0630\u0647\u0627\u0628 \u0625\u0644\u0649 Facebook.com\u003C\/a>");/*jUsb_NI_*/}}/*]]>*/
Bootloader.setResourceMap({"W4XYE":{"type":"css","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yH\/r\/aYddpwJ_7Pk.css"},"ATi+d":{"type":"css","permanent":1,"crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yA\/r\/mTGAMhslQRn.css"},"1PVNX":{"type":"css","permanent":1,"crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y1\/r\/8OmbAAyOhyK.css"},"VuNPD":{"type":"css","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/ys\/r\/ONRYtHPFCvE.css"},"Zt4kK":{"type":"css","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/ya\/r\/A0n6qXxLmWB.css"},"X\/Fq6":{"type":"css","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y_\/r\/yCPVqWSng4X.css"},"7VvoI":{"type":"css","permanent":1,"crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yj\/r\/nEmTqjHSYw3.css"},"VDymv":{"type":"css","permanent":1,"crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y-\/r\/_2IqN3LM44G.css"}});Bootloader.setResourceMap({"S24SH":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y7\/r\/hFeetW9KeBR.js"},"t9\/e3":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yG\/r\/JFHcjjotxAH.js"},"WKgve":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yb\/r\/fguuf2bVsHz.js"},"WLpRY":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yp\/r\/3JPjcNnM776.js"},"oE4Do":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yD\/r\/65c9OW-i481.js"},"MqSmz":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yH\/r\/ghlEJgSKAee.js"},"+NCcw":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/ye\/r\/N7svX6x453A.js"},"wddSE":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y6\/r\/OhxzP8fH_kb.js"},"JE+14":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yI\/r\/_MXQrYm5Ixs.js"},"7Dff+":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yO\/r\/1rshcD2ln3k.js"},"MVb31":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yP\/r\/k4HBrtkorDT.js"},"m9Vmx":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yK\/r\/YfWOZetYz1g.js"},"ugHfa":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yZ\/r\/2MSnhW2nINL.js"},"hB8zw":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yy\/r\/fXOTCRXeuS-.js"},"ZQXFg":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y7\/r\/O8-k_24e9jp.js"},"cNca2":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yv\/r\/OHUUx9tXXmr.js"},"\/vuZw":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y1\/r\/nXiCuej3Ax_.js"},"bwsMw":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y_\/r\/hwOyT9fmfZV.js"},"5pnaw":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yl\/r\/kWJnv-D3gdj.js"},"6IiSO":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y-\/r\/QlLbKHVEeTf.js"},"zyFOp":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yA\/r\/HAFtXNlDnG9.js"},"7JCUA":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/ya\/r\/g5Lqnffzu2N.js"},"h9fqQ":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yi\/r\/jU-wSqGgWYI.js"},"y58yA":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yj\/r\/oEVUwtumVWC.js"},"2ma5f":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yA\/r\/DpvUNDehyjp.js"},"E1q5V":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y0\/r\/v1rvWTHWGIp.js"},"wxq+C":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yL\/r\/fh5ruZOm80K.js"},"Rs18G":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yN\/r\/7NckTJJ_l8J.js"},"H42Jh":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y3\/r\/ppwOo4BAmlb.js"},"AtxWD":{"type":"js","crossOrigin":1,"src":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y5\/r\/3QU5LsAd2e8.js"}});
Bootloader.enableBootload({"AsyncSignal":{"resources":["S24SH"],"module":true},"AsyncDOM":{"resources":["S24SH","WLpRY"],"module":true},"ConfirmationDialog":{"resources":["S24SH","t9\/e3","oE4Do"],"module":true},"Dialog":{"resources":["S24SH","t9\/e3","ATi+d"],"module":true},"IframeShim":{"resources":["S24SH","t9\/e3","MqSmz"],"module":true},"editor":{"resources":["S24SH","t9\/e3","+NCcw","wddSE","JE+14"]},"registration":{"resources":["S24SH","t9\/e3","+NCcw","wddSE","JE+14","Zt4kK","7Dff+","MVb31","ATi+d","m9Vmx","ugHfa","hB8zw","ZQXFg"]},"ErrorSignal":{"resources":["S24SH","cNca2"],"module":true},"Event":{"resources":["S24SH"],"module":true},"AsyncDialog":{"resources":["S24SH","t9\/e3","ATi+d"],"module":true},"FbdDialogProvider":{"resources":["\/vuZw","S24SH","bwsMw"],"module":true},"React":{"resources":["5pnaw","S24SH"],"module":true},"AsyncRequest":{"resources":["S24SH"],"module":true},"PhotoSnowlift":{"resources":["S24SH","t9\/e3","ATi+d","6IiSO"],"module":true},"SpotlightShareViewer":{"resources":["S24SH","t9\/e3","X\/Fq6","zyFOp"],"module":true},"PhotoTagger":{"resources":["S24SH","t9\/e3","ATi+d","7JCUA","6IiSO","h9fqQ"],"module":true},"fb-photos-snowlift-css":{"resources":["7VvoI","ATi+d"]},"Live":{"resources":["S24SH","WLpRY","5pnaw"],"module":true},"PhotoTagApproval":{"resources":["S24SH","6IiSO","h9fqQ"],"module":true},"PhotoTags":{"resources":["S24SH","6IiSO","ATi+d","h9fqQ"],"module":true},"TagTokenizer":{"resources":["S24SH","y58yA","h9fqQ","ATi+d","t9\/e3"],"module":true},"fb-photos-snowlift-fullscreen-css":{"resources":["VDymv"]},"PhotoPivot":{"resources":["S24SH","t9\/e3","6IiSO","ATi+d","2ma5f"],"module":true},"SnowliftPicCropper":{"resources":["S24SH","t9\/e3","ATi+d","6IiSO","1PVNX","E1q5V","wxq+C"],"module":true},"PhotosButtonTooltips":{"resources":["S24SH","t9\/e3","ATi+d","Rs18G"],"module":true},"VideoRotate":{"resources":["S24SH","H42Jh"],"module":true},"AsyncResponse":{"resources":["S24SH"],"module":true},"PhotoInlineEditor":{"resources":["S24SH","6IiSO","t9\/e3","ATi+d","h9fqQ","AtxWD"],"module":true},"Form":{"resources":["S24SH","t9\/e3"],"module":true},"Toggler":{"resources":["S24SH","t9\/e3","ATi+d"],"module":true},"Tooltip":{"resources":["S24SH","t9\/e3","ATi+d"],"module":true},"DOM":{"resources":["S24SH"],"module":true},"Input":{"resources":["S24SH","t9\/e3"],"module":true},"trackReferrer":{"resources":[],"module":true},"DimensionTracking":{"resources":["S24SH"],"module":true},"HighContrastMode":{"resources":["S24SH"],"module":true},"legacy:detect-broken-proxy-cache":{"resources":["S24SH"]},"legacy:link-rel-preload":{"resources":["S24SH"]},"AjaxPipeRequest":{"resources":["S24SH","t9\/e3"],"module":true}});
require("InitialJSLoader").loadOnDOMContentReady(["S24SH","t9\/e3","WKgve"]);

Bootloader.configurePage(["W4XYE","ATi+d","1PVNX","VuNPD"]);
Bootloader.done(["jDr+c"]);


require("InitialJSLoader").handleServerJS({"instances":[["m_0_9",["ContextualDialog","ContextualDialogArrow","LayerFadeOnHide","LayerRemoveOnHide","LayerHideOnTransition","LayerHideOnBlur","LayerFadeOnShow","ContextualLayerAutoFlip","DialogHideOnSuccess","m_0_a"],[{"width":200,"context":null,"contextID":"u_0_5","contextSelector":null,"position":"below","alignment":"center","offsetX":0,"offsetY":0,"arrowBehavior":{"__m":"ContextualDialogArrow"},"addedBehaviors":[{"__m":"LayerFadeOnHide"},{"__m":"LayerRemoveOnHide"},{"__m":"LayerHideOnTransition"},{"__m":"LayerHideOnBlur"},{"__m":"LayerFadeOnShow"},{"__m":"ContextualLayerAutoFlip"},{"__m":"DialogHideOnSuccess"}],"attributes":{"id":"login_chooser_contextual_dialog"}},{"__m":"m_0_a"}],3],["m_0_b",["ContextualDialog","ContextualDialogArrow","LayerFadeOnHide","LayerRemoveOnHide","LayerHideOnTransition","LayerHideOnBlur","LayerFadeOnShow","ContextualLayerAutoFlip","DialogHideOnSuccess","m_0_c"],[{"width":300,"context":null,"contextID":null,"contextSelector":"#user_chooser_user_box_100004046143698","position":"below","alignment":"center","offsetX":0,"offsetY":0,"arrowBehavior":{"__m":"ContextualDialogArrow"},"addedBehaviors":[{"__m":"LayerFadeOnHide"},{"__m":"LayerRemoveOnHide"},{"__m":"LayerHideOnTransition"},{"__m":"LayerHideOnBlur"},{"__m":"LayerFadeOnShow"},{"__m":"ContextualLayerAutoFlip"},{"__m":"DialogHideOnSuccess"}],"attributes":{"id":"login_chooser_contextual_dialog_opt_in"},"classNames":["_50nr"]},{"__m":"m_0_c"}],3]],"markup":[["m_0_a",{"__html":"\u003Cdiv>\u003Cdiv class=\"_ke\">\u003Cdiv class=\"_4--j\">\u003Cul role=\"menu navigation\">\u003Cli role=\"menuitem\">\u003Clabel class=\"uiLinkButton _50am navSubmenu\">\u003Cinput name=\"clear_list\" type=\"submit\" value=\"‎Clear Recent Logins‎\" \/>\u003C\/label>\u003C\/li>\u003Cli class=\"menuDivider\">\u003C\/li>\u003Cli role=\"menuitem\">\u003Clabel class=\"uiLinkButton _50an navSubmenu\">\u003Cinput name=\"turn_off_feature\" type=\"submit\" value=\"‎Turn Off Recent Logins‎\" \/>\u003C\/label>\u003C\/li>\u003C\/ul>\u003C\/div>\u003C\/div>\u003C\/div>"},2],["m_0_c",{"__html":"\u003Cdiv>\u003Cdiv class=\"_ke\">\u003Cdiv class=\"mbs fwb\">\u200eNew! Log In Faster\u200e\u003C\/div>\u003Cdiv>\u200eSave your email or phone so you don't have to enter this info every time you log in.\u200e\u003C\/div>\u003C\/div>\u003Cdiv class=\"uiOverlayFooter _k7 uiBoxGray topborder\">\u003Ca class=\"_42ft _42fu layerCancel uiOverlayButton\" role=\"button\" href=\"#\" id=\"button_chooser_optin_no\">\u0644\u064a\u0633 \u0627\u0644\u0622\u0646\u003C\/a>\u003Cbutton value=\"1\" class=\"_42ft _42fu layerConfirm uiOverlayButton selected _42g-\" id=\"button_chooser_optin_yes\" type=\"submit\">\u0645\u0648\u0627\u0641\u0642\u003C\/button>\u003C\/div>\u003C\/div>"},2]],"elements":[["m_0_1","firstname",2],["m_0_2","lastname",2],["m_0_3","reg_email__",2],["m_0_4","reg_email_confirmation__",2],["m_0_5","reg_passwd__",2],["m_0_6","login_form",2],["m_0_7","loginbutton",2],["m_0_8","login_form",2],["m_0_d","login_chooser_container",2],["m_0_g","u_0_5",2],["m_0_e","u_0_6",2],["m_0_f","user_chooser_user_container",2],["m_0_0","reg",2]],"define":[["BanzaiConfig",[],{"MAX_SIZE":10000,"MAX_WAIT":60000,"COMPRESSION_THRESHOLD":800,"gks":{"jslogger":true,"miny_compression":true,"time_spent":true,"time_spent_bit_array":true,"time_spent_debug":true,"useraction":true}},7]],"require":[["PixelRatio","startDetecting",[],[1]],["StickyPlaceholderInput","registerInput",["m_0_1"],[{"__m":"m_0_1"}]],["PlaceholderListener"],["PlaceholderOnsubmitFormListener"],["FlipDirectionOnKeypress"],["StickyPlaceholderInput","registerInput",["m_0_2"],[{"__m":"m_0_2"}]],["StickyPlaceholderInput","registerInput",["m_0_3"],[{"__m":"m_0_3"}]],["StickyPlaceholderInput","registerInput",["m_0_4"],[{"__m":"m_0_4"}]],["StickyPlaceholderInput","registerInput",["m_0_5"],[{"__m":"m_0_5"}]],["Intl","setPhonologicalRules",[],[{"meta":{"\/_RTL\/":"(([\u0590-\u05bf]|[\u05c0-\u07ff]))","\/_Delim\/":"(\u0001\u200f)","\/_B\/":"([.,!?\\s]|^)","\/_E\/":"([.,!?\\s]|$)"},"patterns":{"\/\u0629_Delim_RTL\/":"\u062a\u0001$2","\/_RTL_Delim(\\s*)_RTL\/":"$1\u0001$4$5","\/_\u0001([^\u0001]*)\u0001\/e":"mb_strtolower(\"\u0001$1\u0001\")","\/\\^\\x01([^\\x01])(?=[^\\x01]*\\x01)\/e":"mb_strtoupper(\"\u0001$1\")","\/_\u0001([^\u0001]*)\u0001\/":"javascript"}}]],["PostLoadJS","loadAndRequire",[],["DimensionTracking"]],["PostLoadJS","loadAndCall",[],["HighContrastMode","init",[{"currentState":"0","spacerImage":"https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/y4\/r\/-PAXP-deijE.gif"}]]],["ScriptPath","set",[],["\/index.php","849445de"]],["ClickRefLogger"],["userAction","setUATypeConfig",[],[{"ua:n":false,"ua:i":false,"ua:d":false,"ua:e":false}]],["ScriptPathState","setUserURISampleRate",[],[0.0002]],["userAction","setCustomSampleConfig",[],[{"uan":{"test":{"test":true}}}]],["UserActionHistory"],["TinyViewport"],["WebStorageMonster","schedule",[],[false]],["AsyncRequestNectarLogging"],["LoginFormController","init",["m_0_6","m_0_7"],[{"__m":"m_0_6"},{"__m":"m_0_7"}]],["m_0_9"],["m_0_b"],["LoginChooserMenu","setup",["m_0_d","m_0_e","m_0_f","m_0_g","m_0_9","m_0_b"],[false,{"__m":"m_0_d"},{"__m":"m_0_e"},{"__m":"m_0_f"},{"__m":"m_0_g"},{"__m":"m_0_9"},{"id":100004046143698,"time":1363824681,"name":"\u0633\u0644\u0637\u0627\u0646 \u0639\u0628\u062f\u0627\u0644\u0646\u0627\u0635\u0631 \u0627\u0644\u0634\u0627\u064a\u0641","pic_url":"https:\/\/fbcdn-profile-a.akamaihd.net\/hprofile-ak-ash4\/c34.0.113.113\/s100x100\/252231_1002029915278_1941483569_a.jpg"},{"__m":"m_0_b"}]]]});

onloadRegister_DEPRECATED(function (){useragentcm();});
onloadRegister_DEPRECATED(function (){RegistrationBootloader.init("registration_container", true, "reg", "form_focus", "https:\/\/www.facebook.com\/ajax\/register.php");});
onloadRegister_DEPRECATED(function (){startFormTypeABTester($("reg"))});
onloadRegister_DEPRECATED(function (){$("u_0_3").value = tz_calculate(1363824681)});
onloadRegister_DEPRECATED(function (){try { $("email").focus(); } catch (_ignore) { }});
onafterloadRegister_DEPRECATED(function (){Bootloader.loadComponents(["legacy:detect-broken-proxy-cache"], function(){ detect_broken_proxy_cache("0", "c_user") });});
onafterloadRegister_DEPRECATED(function (){Bootloader.loadComponents(["legacy:link-rel-preload"], function(){ link_rel_preload() });});

var bigPipe = new (require('BigPipe'))({"lid":0,"forceFinish":true});

bigPipe.onPageletArrive({"is_last":true,"css":["W4XYE","ATi+d","1PVNX","VuNPD"],"js":["S24SH","t9\/e3","WKgve"],"id":"first_response","phase":0})

bigPipe.onPageletArrive({"is_last":true,"css":["W4XYE","ATi+d","1PVNX","VuNPD"],"js":["S24SH","t9\/e3","WKgve"],"id":"","phase":1,"the_end":true})

21.12.2012 -

bydjvisitox says …

set

17.12.2012 -

ttkhanhmy says …

- sao việt nam ko đăng ký được tên miền ?

View all user comments for this tutorial.

Tutorial statistics

Date added:
23.08.2007
Author:
Alex Elliott
User rating:
4/5
Rate tutorial:
Total views:
69039
Total comments:
171

Advertisements