sKunKbad Posted May 5, 2007 Share Posted May 5, 2007 NOT WORKING <a href="trytoinclude.php?OldPage=1">Index w/ Static text#1</a> <h1>Old Content</h1> <?php $pageNum = $_GET['OldPage']; // in this case OldPage = 1 print('<div>'); include('staticdoc'.$pageNum.'.txt'); print('</div>'); ?> PLEASE HELP Link to comment https://forums.phpfreaks.com/topic/50176-include-w-variable/ Share on other sites More sharing options...
triphis Posted May 5, 2007 Share Posted May 5, 2007 Um, works just fine for me... I mean, I get errors obviously, because I don't have those .txt docs.. but yeah: Warning: include(staticdoc2.txt) [function.include]: failed to open stream: No such file or directory in /home/zedthrea/public_html/store/index2.php on line 49 Warning: include() [function.include]: Failed opening 'staticdoc2.txt' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/zedthrea/public_html/store/index2.php on line 49 was what I got when I set OldPage=2 in my URL o.O; Try it again? lol Link to comment https://forums.phpfreaks.com/topic/50176-include-w-variable/#findComment-246359 Share on other sites More sharing options...
sKunKbad Posted May 5, 2007 Author Share Posted May 5, 2007 yeah, i was just being an idiot. it worketh. Link to comment https://forums.phpfreaks.com/topic/50176-include-w-variable/#findComment-246360 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.