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 Link to comment https://forums.phpfreaks.com/topic/45256-instead-of-define-text-information/ 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 Link to comment https://forums.phpfreaks.com/topic/45256-instead-of-define-text-information/#findComment-219727 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 ? Link to comment https://forums.phpfreaks.com/topic/45256-instead-of-define-text-information/#findComment-219733 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. Link to comment https://forums.phpfreaks.com/topic/45256-instead-of-define-text-information/#findComment-219737 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')); Link to comment https://forums.phpfreaks.com/topic/45256-instead-of-define-text-information/#findComment-219756 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 Link to comment https://forums.phpfreaks.com/topic/45256-instead-of-define-text-information/#findComment-219774 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')); Link to comment https://forums.phpfreaks.com/topic/45256-instead-of-define-text-information/#findComment-219849 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.