Jump to content


Photo

Inserting a text file into a page


  • Please log in to reply
10 replies to this topic

#1 st3a1th

st3a1th
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 11 March 2006 - 11:46 AM

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.destructi....co.uk/npc.txt" width="640" height="480">

any help or ideals would be greatful

#2 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 11 March 2006 - 11:52 AM

If all you want to do is include the file the code is

<?php include("filename"); ?>

Now if you mean you want a pretty little scrollable area, then I would suggested a <div></div>.

<div style="width: 600px; height: 600px; overflow: scroll;"><?php include("filename"); ?></div>

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.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.


#3 st3a1th

st3a1th
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 11 March 2006 - 11:57 AM

Thank you, You been a great help :) i such a noob at this i use php nuke lol

#4 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 11 March 2006 - 02:27 PM

<?php
include 'http://www.destructiveforce.co.uk/npc.txt';
?>

You can jazz it up, put it in an IFrame, whatever...

#5 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 12 March 2006 - 05:48 AM

Do NOT use iframes! That's aweful!

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.


#6 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 12 March 2006 - 05:57 AM

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?

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#7 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 12 March 2006 - 06:00 AM

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...

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.


#8 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 12 March 2006 - 06:50 AM

[!--quoteo(post=354092:date=Mar 12 2006, 06:00 AM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Mar 12 2006, 06:00 AM) View Post[/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.

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#9 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 12 March 2006 - 07:36 AM

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.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.


#10 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 12 March 2006 - 07:48 AM

[!--quoteo(post=354119:date=Mar 12 2006, 07:36 AM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Mar 12 2006, 07:36 AM) View Post[/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..

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#11 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 12 March 2006 - 08:59 AM

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.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users