CodeIgniter Forums
No direct script access allowed - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: No direct script access allowed (/showthread.php?tid=49341)

Pages: 1 2


No direct script access allowed - El Forum - 02-16-2012

[eluser]qwertyjjj[/eluser]
I just installed CI and went to this address http://localhost/application/config/config.php
but I get the error:
No direct script access allowed

Any ideas?


No direct script access allowed - El Forum - 02-16-2012

[eluser]Mauricio de Abreu Antunes[/eluser]
It's a validation created in your php file (config.php).
Read your file. Smile


No direct script access allowed - El Forum - 02-16-2012

[eluser]InsiteFX[/eluser]
You may also need to configure your browser to allow javascript.



No direct script access allowed - El Forum - 02-16-2012

[eluser]porquero[/eluser]
Well, the question is: Why you need access to config file by url?

For security reasons you can't access to php file directly. You must use mvc.


No direct script access allowed - El Forum - 02-16-2012

[eluser]InsiteFX[/eluser]
If you look at the .htacess file in the ./application directory you will see why your getting that error!



No direct script access allowed - El Forum - 02-16-2012

[eluser]Aken[/eluser]
[quote author="InsiteFX" date="1329392712"]You may also need to configure your browser to allow javascript.
[/quote]
What on earth does this have to do with the problem he's having? lol


No direct script access allowed - El Forum - 02-16-2012

[eluser]InsiteFX[/eluser]
Because you will get the same error if javascript is turned off in the browser!



No direct script access allowed - El Forum - 02-16-2012

[eluser]qwertyjjj[/eluser]
[quote author="InsiteFX" date="1329432600"]Because you will get the same error if javascript is turned off in the browser!
[/quote]

On another note, does anyone actually turn off Javascript anymore?
I think this is just one of those things programmers liked to worry about whereas in reality most people don't even know what Javascript is or how to change a setting so they just leave it as it is.
ALmost every single website uses javascript, jQuery or other nowadays so why would anyone ever turn it off.


No direct script access allowed - El Forum - 02-16-2012

[eluser]Aken[/eluser]
[quote author="InsiteFX" date="1329432600"]Because you will get the same error if javascript is turned off in the browser!
[/quote]
Only if someone actually set up a noscript element and added that message. And it CLEARLY is from the no basepath bit of code that's at the top of every CI-based application file.


No direct script access allowed - El Forum - 02-16-2012

[eluser]CroNiX[/eluser]
A lot of search engines still don't use javascript, or only use limited javascript. So, it is still important from a SEO standpoint.