werushka Posted April 2, 2007 Share Posted April 2, 2007 ?php define('NAVBAR_TITLE', 'Agrement'); define('HEADING_TITLE', 'Agrement'); define('TEXT_INFORMATION', 'include path to text file here in the same folder'); ?> above instead of text information I would like to link to formattet text file.. would really appreciate any help Quote Link to comment Share on other sites More sharing options...
desithugg Posted April 2, 2007 Share Posted April 2, 2007 <? $path = $_GET['path']; //lets say the path variable has the value main function TEXT_INFORMATION($path) { global $path; $path = $path.".php"; include($path); } //and to execute it you would do TEXT_INFORMATION(); ?> umm i don't think you need the () at the end but i've never tried it without you can give it a shot Quote Link to comment Share on other sites More sharing options...
neel_basu Posted April 2, 2007 Share Posted April 2, 2007 I didn't Understand your Problem at all.Can you show an example ? Quote Link to comment Share on other sites More sharing options...
werushka Posted April 2, 2007 Author Share Posted April 2, 2007 define('TEXT_INFORMATION' well if i define text information when the user opens the page that php code above is included it would post the text after define('TEXT_INFORMATION' on the page but instead of posting the text information I would want to include a .txt which is formatted and that would show on the page. Quote Link to comment Share on other sites More sharing options...
neel_basu Posted April 2, 2007 Share Posted April 2, 2007 Use define('TEXT_INFORMATION', file_get_contents('path/to/your/file.txt')); Quote Link to comment Share on other sites More sharing options...
werushka Posted April 2, 2007 Author Share Posted April 2, 2007 define('TEXT_INFORMATION', file_get_contents('/test.txt')); thanks for your quick reply but this does not seem to work test.txt is in the same folder as currentphpfileweareworkingon.php Quote Link to comment Share on other sites More sharing options...
neel_basu Posted April 2, 2007 Share Posted April 2, 2007 Try this define('TEXT_INFORMATION', file_get_contents('test.txt')); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.