Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Secure website URL
  • HI fuel friends, today I faced a big issue and as I am still new to fuelphp I wonder how we can secure our URLs to prevent anyone from writing it and get its results, I tried the before() function with Auth class things were fine until I tried Ajax, the request gets rejected and redirected back, what I want is to be able to get json results with AJAX request but no by typing the url in the browser.
  • Using this code resolved the problem :)

    if(!Input::is_ajax())
      \Response::redirect_back();
  • HarroHarro
    Accepted Answer
    We usually throw a HttpNotFoundError instead.

    Often in combination with an environment check, so you can use a browser in development to dump the response of an API call in HTML for debugging purposes, and to give a 404 when the site runs in staging or production.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion