Load ajax data from password protected folder

Load ajax data from password protected folder

EBSEBS Posts: 2Questions: 1Answers: 1

Hello,

I have a 'child row' table following the example which is working fine loading data from an ajax helper file. However I want to put the helper file in a password protected folder. Does anyone know how to do this please. I have setup a user and password for the folder and modified by script as below but I don't really know what I'm doing, so any advice would be welcome please.

Many thanks

var table = $('#mytable').DataTable( {
   ajax": "/protected_folder/ajax_data.php",
   "columns": [
   {
      "user": "XXXXXXXX",
      "password": "XXXXXXX",
      "className":      'details-control',
      "orderable":      false,
      "data":           null,
       "defaultContent": ''
      },
      { "data": "firstname" },
      { "data": "surname" },
      { "data": "region" },
      { "data": "membersince" }
   ],
   "order": [[2, 'asc']],
   stateSave: true,
   "pagingType": "full_numbers"
} );

This question has accepted answers - jump to:

Answers

  • EBSEBS Posts: 2Questions: 1Answers: 1
    Answer ✓

    Got it. :)

    "ajax": {
        "url": "/protected_folder/ajax_data.php",
        "username": "XXXXXX",
        "password": "XXXXXXXX"
    },
    
  • allanallan Posts: 63,360Questions: 1Answers: 10,448 Site admin
    Answer ✓

    yup - exactly like that. Good to hear you found the answer :-)

    Allan

This discussion has been closed.