Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.5.8

Request #9962 Add method to check if the page request is from Ajax
Submitted: 2007-01-29 05:50 UTC
From: lsolesen Assigned: jeichorn
Status: Closed Package: HTML_AJAX (version 0.5.0)
PHP Version: 5.2.0 OS: Irrelevant
Roadmaps: 0.5.1    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 17 + 34 = ?

 
 [2007-01-29 05:50 UTC] lsolesen (Lars Olesen)
Description: ------------ I want to make pages which are usable without Ajax, and I don't want to code more than I have to. Therefore it would be nice if HTML_Ajax could tell me if the request to a page was Ajax-related or not. Test script: --------------- <?php // business logic if ($_SERVER['REQUEST_METHOD'] == 'POST') { // something is fetched from a database if ($ajax->isAjax()) { echo 'The Ajax response so it can be used on the page'; } else { // reload page header('Location: page.php'); exit; } } ?>

Comments

 [2007-03-05 21:23 UTC] jeichorn (Joshua Eichorn)
isAJAX method added to HTML_AJAX_Helper in svn