st3a1th Posted March 11, 2006 Share Posted March 11, 2006 Hello i am trying to insert a text file into a php document i have tried the following, however it only gives me an empty doc. <embed src="http://www.destructiveforce.co.uk/npc.txt" width="640" height="480">any help or ideals would be greatful Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/ Share on other sites More sharing options...
txmedic03 Posted March 11, 2006 Share Posted March 11, 2006 If all you want to do is include the file the code is [code]<?php include("filename"); ?>[/code]Now if you mean you want a pretty little scrollable area, then I would suggested a <div></div>.[code]<div style="width: 600px; height: 600px; overflow: scroll;"><?php include("filename"); ?></div>[/code]Now I do strongly recommend you do not use inline styles, but I didn't feel like making a code called stylesheet.css and then showing you how the code would look in the page. You'll just have to wing it on that one or jump over to the CSS forums and ask for further guidance. Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16390 Share on other sites More sharing options...
st3a1th Posted March 11, 2006 Author Share Posted March 11, 2006 Thank you, You been a great help :) i such a noob at this i use php nuke lol Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16392 Share on other sites More sharing options...
AV1611 Posted March 11, 2006 Share Posted March 11, 2006 [code]<?phpinclude 'http://www.destructiveforce.co.uk/npc.txt';?>[/code]You can jazz it up, put it in an IFrame, whatever... Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16413 Share on other sites More sharing options...
txmedic03 Posted March 12, 2006 Share Posted March 12, 2006 Do NOT use iframes! That's aweful! Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16578 Share on other sites More sharing options...
keeB Posted March 12, 2006 Share Posted March 12, 2006 A small note..If at all possible you should probably change that to .php extension just to enhance functionality if you ever need to. Better to do it now that later, right? Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16579 Share on other sites More sharing options...
txmedic03 Posted March 12, 2006 Share Posted March 12, 2006 No, keeB, no one said it was ever going to be anything more than text. It may be just technical data or something. Either way would work, but you must not assume anything... Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16580 Share on other sites More sharing options...
keeB Posted March 12, 2006 Share Posted March 12, 2006 [!--quoteo(post=354092:date=Mar 12 2006, 06:00 AM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Mar 12 2006, 06:00 AM) [snapback]354092[/snapback][/div][div class=\'quotemain\'][!--quotec--]No, keeB, no one said it was ever going to be anything more than text. It may be just technical data or something. Either way would work, but you must not assume anything...[/quote]follow that link to see what it is.. and even if it weren't that, if it were technical data, there would be no harm in encapsulating it as a .php instead of .txt.. I can't think of a reason not to. Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16594 Share on other sites More sharing options...
txmedic03 Posted March 12, 2006 Share Posted March 12, 2006 Which is just exactly what I said keeB. It will work fine either way, but they asked for an include of a text file without stating any intentions. Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16606 Share on other sites More sharing options...
keeB Posted March 12, 2006 Share Posted March 12, 2006 [!--quoteo(post=354119:date=Mar 12 2006, 07:36 AM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Mar 12 2006, 07:36 AM) [snapback]354119[/snapback][/div][div class=\'quotemain\'][!--quotec--]Which is just exactly what I said keeB. It will work fine either way, but they asked for an include of a text file without stating any intentions.[/quote]And I advised to consider changing the .txt into a .php file to add the option of further enhancing in the future.. Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16607 Share on other sites More sharing options...
txmedic03 Posted March 12, 2006 Share Posted March 12, 2006 Which I simply stated was not needed. You are giving them extra work changing X number of files and rewriting all scripts to use .php extension when, if they do not plan on adding anything more than text, it is just extra work on them. Quote Link to comment https://forums.phpfreaks.com/topic/4682-inserting-a-text-file-into-a-page/#findComment-16618 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.