ztealmax Posted December 13, 2006 Share Posted December 13, 2006 [code]<?PHP require_once("theme.php");?><?php// set file to read$file = $_GET['text'];// open file $fh = fopen($file, 'r') /*or die('Could not open file!')*/;// read file contents$data = fread($fh, filesize($file)) /*or die('Could not read file!')*/;// close file fclose($fh); // print file contents ?><DIV class="smallblacktext"><? echo $data;?></DIV>[/code]My read text file script cant recognize line breaks from a .txt filefor example of text file:[code]This is my computer and it rocks....This is my keyboard and it rocks too..[/code]in my code it comes up like this:[code]This is my computer and it rocks....This is my keyboard and it rocks too..[/code]Does anyone know how to sort it out? Quote Link to comment Share on other sites More sharing options...
papaface Posted December 13, 2006 Share Posted December 13, 2006 [code]<DIV class="smallblacktext"><pre><? echo $data;?></DIV></pre>[/code]That should do it. Quote Link to comment Share on other sites More sharing options...
ztealmax Posted December 13, 2006 Author Share Posted December 13, 2006 [quote author=devnerds link=topic=118444.msg484010#msg484010 date=1166012327][code]<DIV class="smallblacktext"><pre><? echo $data;?></DIV></pre>[/code]That should do it.[/quote]thanx worked great ;)however i didnt see [code]<pre></pre>[/code] saw it first when i comented you ;)Thanx :D** Noticed you saw that it wasnt showing up too ** ;) 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.