Welcome Guest, Not a member yet? Register   Sign In
My Request helper or library
#1

[eluser]Ngulo[/eluser]
hi all i'm trying to build up my simple personal request_helper just to verify if requests
isPost() or isGet() or isAjax()
i named my helper as request_helper and i load it by default in the autoload class.

i'm trying coding it so:
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');



    function isGet($_GET)
        {
            if($_GET)
            {
                return isset($_GET);
            }
        }
        function isPost($_POST)
        {
            if($_POST)
            {
                return isset($_POST);
            }
        }
        function isAjax($_SERVER)
        {
            if($_SERVER['HTTP_X_REQUESTED_WITH'])
            {
                return isset($_SERVER['HTTP_X_REQUESTED_WITH']) == 'XMLHttpRequest';
            }
        }

when i make
Code:
if($this->request->isPost())
                {
                    echo 'yes is post';
                }

the result is
Code:
Call to a member function isPost() on a non-object

have you any suggestion guys Sad ?


Messages In This Thread
My Request helper or library - by El Forum - 09-05-2010, 06:33 AM
My Request helper or library - by El Forum - 09-05-2010, 09:27 AM
My Request helper or library - by El Forum - 09-05-2010, 09:43 AM
My Request helper or library - by El Forum - 09-05-2010, 09:54 AM
My Request helper or library - by El Forum - 09-05-2010, 09:57 AM
My Request helper or library - by El Forum - 09-05-2010, 10:23 AM
My Request helper or library - by El Forum - 09-05-2010, 12:43 PM
My Request helper or library - by El Forum - 09-05-2010, 02:38 PM
My Request helper or library - by El Forum - 09-06-2010, 12:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB