Welcome Guest, Not a member yet? Register   Sign In
Call A Raw PHP File
#2

Sometimes when I have a file that I want to run outside of CodeIgniter, I'll just put it in a directory that exists at web root. Local Apache configuration is normally set to route all requests through CodeIgniter, except when files exist, and those are run or run/served as stand-alone scripts.

If you'd rather run files from CodeIgniter, you could do something with the routes config, and then inside your controller just use PHP's include function to process the script. Be careful not to allow a person to execute a script by modifying the URL, or you could be letting them run any file on the server. Instead, have a pre-defined set of routes that must be matched in order that a specific php script be included.

Both ideas presented are just basic php and/or webserver usage.
Reply


Messages In This Thread
Call A Raw PHP File - by minianorollyc - 01-16-2017, 10:05 PM
RE: Call A Raw PHP File - by skunkbad - 01-16-2017, 11:51 PM
RE: Call A Raw PHP File - by minianorollyc - 01-17-2017, 12:22 AM
RE: Call A Raw PHP File - by skunkbad - 01-17-2017, 03:53 PM
RE: Call A Raw PHP File - by ivantcholakov - 01-17-2017, 01:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB