10 Replies - 36510 Views - Last Post: 13 July 2012 - 08:56 AM Rate Topic: -----

#1 czach   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 02-October 09

CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 07:42 AM

i got this text box and a button where i input something in the text box and save it in my database... im using codeigniter so basically im using the model-view-control method... i have this code...

$("#test").click(function(){
    $val = $("#user").val()

    $.ajax({
        url: "system/application/?mclts_c/save_test",
        type: "POST",
        datatype: "html",
        data: "user=$val",
        success: function(html){
         alert(html);
        }
    })
});


im trying to pass the data to my controller and i think its working because its returning an alert box but the problem is whats inside the alert box is "Directory access is forbidden"... i think its because i cant seem to access my controller.. but i cant fix it.. maybe you guys know a solution for this?... please help!..

This post has been edited by czach: 28 August 2010 - 07:45 AM


Is This A Good Question/Topic? 1
  • +

Replies To: CodeIgniter Controller: Directory access forbidden

#2 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4303
  • View blog
  • Posts: 13,677
  • Joined: 08-June 10

Re: CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 07:45 AM

View Postczach, on 28 August 2010 - 02:42 PM, said:

but the problem is whats inside the alert box is "Directory access is forbidden" and i don't know where the problem is..

that pretty much describes your problem. you’re not allowed to access the file you want. if that also happens when you call the URL manually, you need to set the access permissions accordingly.
Was This Post Helpful? 0
  • +
  • -

#3 czach   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 02-October 09

Re: CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 07:50 AM

im sorry but im really new with all of this.. what do you mean by accessing it manually?...
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4303
  • View blog
  • Posts: 13,677
  • Joined: 08-June 10

Re: CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 07:51 AM

type system/application/?mclts_c/save_test instead of the current file name into the address bar and hit enter.

This post has been edited by Dormilich: 28 August 2010 - 07:51 AM

Was This Post Helpful? 0
  • +
  • -

#5 czach   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 02-October 09

Re: CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 07:55 AM

i think you're right. i cant access it. so how do i set the permissions?
Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6260
  • View blog
  • Posts: 24,030
  • Joined: 23-August 08

Re: CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 07:55 AM

Modified title to be descriptive; please try to put your problem in as few words as possible in the title. Using a title like "got a problem and i can't fix it.. need help!" is dumb...obviously you have a problem that you can't fix and with which you need help; why else would you be here ASKING a question???
Was This Post Helpful? 0
  • +
  • -

#7 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4303
  • View blog
  • Posts: 13,677
  • Joined: 08-June 10

Re: CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 07:57 AM

View Postczach, on 28 August 2010 - 02:55 PM, said:

so how do i set the permissions?

on *NIX you’d use the chmod command, no idea what you’d use on windows.
Was This Post Helpful? 0
  • +
  • -

#8 czach   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 02-October 09

Re: CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 07:59 AM

View PostJackOfAllTrades, on 28 August 2010 - 06:55 AM, said:

Modified title to be descriptive; please try to put your problem in as few words as possible in the title. Using a title like "got a problem and i can't fix it.. need help!" is dumb...obviously you have a problem that you can't fix and with which you need help; why else would you be here ASKING a question???


:whistling: got scolded there. sorry about that.
Was This Post Helpful? 0
  • +
  • -

#9 czach   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 02-October 09

Re: CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 08:05 AM

man this is hard...
Was This Post Helpful? 0
  • +
  • -

#10 level1   User is offline

  • D.I.C Head

Reputation: 14
  • View blog
  • Posts: 65
  • Joined: 12-June 08

Re: CodeIgniter Controller: Directory access forbidden

Posted 28 August 2010 - 01:40 PM

You don't want to change the permissions. Codeigniter won't let you access any of the files in the system directory directly, this is by design. Instead you'll need to access it via a url like /mclts_c/save_test (without all the /system/app stuff). If you created a controller with the correct name it should work. If you don't know what I'm talking about watch the intro tutorial on codeigniter.
Was This Post Helpful? 1
  • +
  • -

#11 morrie   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-July 12

Re: CodeIgniter Controller: Directory access forbidden

Posted 13 July 2012 - 08:56 AM

View PostJackOfAllTrades, on 28 August 2010 - 07:55 AM, said:

.....Using a title like "got a problem and i can't fix it.. need help!" is dumb...

I just wanted to note that perhaps calling someone "dumb" while trying to build a community learning forum might be the best thing for all of us. Can't we keep it civil? It turns others off, and I'm sure, offended its target. Just because you know more than someone, doesn't make the other person "dumb". Putting a vague title on a post is a rookie maneuver, but a simple explanation as to why would most likely suffice (without offending anyone).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1