• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP Help - inserting code

yak8998

Member
This shouldn't be too hard I hope 😀

I use the format index.php?art=______
where art points to the pathname and file of the selected article, without the extension. I want to take the file and just drop its contents into the output (ie: print("yadda yadda"). I'm not too experienced with PHP, I figured the best way to do this would be to use the file commands. How would I do this, or is there a better way? Thanks
 
include() or require() the file.

Also note that you're taking in arbitrary text, that the user can modify in any way, and then using that as a pathname of a file to show them. You will need to do some checks on that input before just blindly include()ing a file.
 
Back
Top