Welcome Guest, Not a member yet? Register   Sign In
403 forbidden problem...
#1

[eluser]Unknown[/eluser]
Hi guys, i am self taught so if this question is stupid please still help out It's much appreciatedSmile

So i wrote this javascript to change the content of tabs on my front page
and in the $.get function it's suppose to grab the url and change the content div but it's giving me a 403 error.
php file is sitting in the same directory as my view. how should i code this to let it know it's secure to do so?

-----javascript-----
$(function() {
$("#tabs a").click(function() {
var page = this.hash.substr(1);

$.get("./application/views/"+page+".php",function(gotHtml){ //<-----
console.log(html);
// $("#content").html(gotHtml);
});
});
});
#2

[eluser]Aken[/eluser]
You shouldn't try to access files that are inside the application folder directly. Try creating a normal controller page that loads the specified view, and retrieve that URL instead of the file directly.




Theme © iAndrew 2016 - Forum software by © MyBB