fantasticham Posted December 12, 2008 Share Posted December 12, 2008 Here's the code, it's never failed me before. <?php include("$a.txt"); ?> So I threw that in main.php and uploaded news.txt to test it. So presumably, on my webspace main.php?a=news should include the news file. But I keep getting the same errors, that the news.txt file can't be found. http://www.fantasticham.com/main.php http://www.fantasticham.com/main.php?a=news http://www.fantasticham.com/news.txt Any help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/136655-basic-php-include-code-errors/ Share on other sites More sharing options...
Mchl Posted December 12, 2008 Share Posted December 12, 2008 register_globals is off (and it should be) <?php if(isset($_GET['a'])) { $a = $_GET['a']; include("$a.txt"); } ?> Link to comment https://forums.phpfreaks.com/topic/136655-basic-php-include-code-errors/#findComment-713536 Share on other sites More sharing options...
fantasticham Posted December 12, 2008 Author Share Posted December 12, 2008 Brilliant. Thanks. Link to comment https://forums.phpfreaks.com/topic/136655-basic-php-include-code-errors/#findComment-713541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.