PHP, phân biệt Request và HttpObjectRequest

PHP, phân biệt Request và HttpObjectRequest

Đôi khi bạn cần phân biệt một Request bình thường của Browser và một Ajax Request. Với PHP rất đơn giản như sau:

$_SERVER['HTTP_X_REQUESTED_WITH'] == ‘XMLHttpRequest’

Rất đơn giản.

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Bình luận (0)

 

Add Comment

Filtered HTML

  • Các địa chỉ web và email sẽ tự động được chuyển sang dạng liên kết.
  • Các thẻ HTML được chấp nhận: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Tự động ngắt dòng và đoạn văn.

Plain text

  • No HTML tags allowed.
  • Các địa chỉ web và email sẽ tự động được chuyển sang dạng liên kết.
  • Tự động ngắt dòng và đoạn văn.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Hướng dẫn Debug Drupal PHP trong Vim với Vdebug

Hướng dẫn Debug Drupal PHP trong Vim với Vdebug

I know quite a few developers that love Vim but think they have to use an IDE to be able to debug their applications. In this post I will show you how to set up Vim as a Xdebug client.

Apple sẽ lùi ngày phát hành iTunes 11

Apple sẽ lùi ngày phát hành iTunes 11

Hôm thứ Ba (30/10), Apple cho biết iTunes 11 sẽ bị dời ngày phát hành với lí do có sự chậm trễ bất ngờ và mong muốn dịch vụ được "hoàn thiện thêm".

Giới thiệu jQuery và Subtotaling trong Views Calc Tables - Drupal 7

Giới thiệu jQuery và Subtotaling trong Views Calc Tables - Drupal 7

As a follow up to Drupal 6: Using jQuery to pick up where views_calc falls short, I worked on a project this

Công ty diệt chuột T&C

 

Diet con trung