Start Facebook Application Tutorial for beginner (PHP) (2) by

31
Jul
16

Sorry, this entry is only available in ไทย.

Start Facebook Application Tutorial for beginner (PHP) by

30
Jun
47

PHP APC Cache by

24
May
0

โดยปกติแล้วตัว Native PHP มี flow การทำงานดังนี้

  1. Scanning and Lexing : ตรวจสอบ syntax error ต่างๆ
  2. Parsing : อ่านความหมายของแต่ละคำสั่ง
  3. Compliation : แปลงเป็น run code
  4. Execution

APC PHP มี flow ดังนี้

  1. APC Hook เช็ค Opcode Cache (hit/miss)
  2. Scaning and Lexing
  3. Parsing
  4. Compilation
  5. APC Hook – store opcode (เก็บเข้า cache)
  6. Execution

Installation

  • http://pecl.php.net
  • (Ubuntu) apt-get install php5-apc

ส่วน Memcache มีทุกๆ ภาษาอยู่แล้ว

CI : ใช้ Query String กับ CodeIgniter by

12
May
0

Refer : http://www.askaboutphp.com/tutorials/58/codeigniter-mixing-segment-based-url-with-querystrings.html

Codeigniter ตามปกติจะไม่สามารถใช้งาน URL โดยมีตัวแปน GET (Query String) ได้

example.com/product/search/?pname=test&pid=2

หากต้องการให้ใช้งานได้มีสองวิธี

1. Global

ตั้งค่าใน Config.php ตามนี้

$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings'] = TRUE;

2. Local

แบบ global จะมีปัญหาเล็กน้อยเรื่องตัวแปรชื่อ c , m , d ซึ่งเป็น default สำหรับเรียก controller เมื่อ $config['enable_query_strings'] = TRUE;

แบบ local จะตั้งค่าใน Config.php ตามนี้

$config['enable_query_strings'] = FALSE;
$config['uri_protocol'] = "PATH_INFO";

และใน Controller Initialize ให้แทรกบรรทัดนี้

parse_str($_SERVER['QUERY_STRING'],$_GET);

PHP : Get Full URL path by

30
Mar
0

Code สำหรับ Get URl ปัจจุบันในขณะนั้น


function full_url()
{
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = substr(strtolower($_SERVER["SERVER_PROTOCOL"]), 0, strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "/")) . $s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
}

 เราชนะรอบ 4 | ยืมเงิน 3000 ด่วน | แอพกู้เงิน | แอพเงินด่วน | สินเชื่อออนไลน์อนุมัติทันที | Site Map | กู้เงินก้อน | กระเป๋าตัง | thisshop และ ยืมเงินฉุกเฉิน 5000 ด่วน