Jump to content

Parsing .DAT file


DJDex

Recommended Posts

Hey I'm trying to display information on a webpage that pulls its information from a DAT file.  Here is what I have it seems to find the file but never actually displays information my page jsut displays blank

 

<?php
$fileid = $_GET["id"];
$filename = "C:\\Hosts\\XFRadio_net\\webroot\\data\\$fileid.dat";
$fp = @fopen($filename,"r") or die("Couldn't open file");
$data = fread($fp, filesize($filename));
fclose($fp);
$data2 = explode("|", $data);
$TEST = 'TEST';
?>
<div id="fileholder">
		<div id="fileinfo">
			<div id="fileinfobox">
				<p id="fileinfotext">
				<h2 class="style3"><? echo $data2[0]; ?></h2>
				<p class="style4"> <? echo $data2[1]; ?><br /></p>
				</p>
			</div>   
		</div>	
		<div id="picbox" align="left">
			<div id="pic" align="left">
				<p class="style4"> <? echo $data2[2]; ?></p>
			</div>  
		</div>  		
		<div id="footer2">
		<p id="footer2text">
			<p id="images"><h2 class="style3">Technical Drawings:</h2></p>
			<? echo $data2[3]; ?>
		</p>	

			<? echo $data; ?>
<? echo $TEST; ?>
		</div>
	</div>

 

I tried even just doing a string and this doesn't even display either.  Is there something I'm missing?  This fille is also included via that get command into the main content of my weblayout.  Any help appreciated.  Thanks!

Link to comment
https://forums.phpfreaks.com/topic/157033-parsing-dat-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.