Jump to content

[SOLVED] need help with some code remove searchpath from this code:


ztealmax

Recommended Posts

Hi this is my code when i read text files, i would like it not to show the whole path before the filename as i use the filename as the title

 

news/Welcome to our new website (i would like it not to show the line thats bold)

 

need help with some code remove searchpath from this code:

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

?>
			  
			  
			  
			  
<pre>
</DIV></pre>


</DIV>
             
              
		  

<div class='spacer'>

<table cellpadding='0' cellspacing='0'>
<tr>
<td class='captiontopleft'><img src='".theme."images/blank.gif' width='6' height='30' alt='' style='display: block;' /></td>
<td class='captiontopmiddle' style='white-space:nowrap'><? echo $file ;?></td>
<td class='captiontopright'><img src='".theme."images/blank.gif' width='6' height='30' alt='' style='display: block;' /></td>
</tr>
</table>
<table cellpadding='0' cellspacing='0'>
<tr>
<td class='bodyleft'><img src='".theme."images/blank.gif' width='6' height='1' alt='' style='display: block;' /></td>
<td class='bodymain'><? echo $data;?><br><br><? echo lan_10 . date ("F d Y H:i:s.", filemtime($file)); ?></td>
<td class='bodyright'><img src='".theme."images/blank.gif' width='6' height='1' alt='' style='display: block;' /></td>
</tr>
</table>
<table cellpadding='0' cellspacing='0'>
<tr>
<td class='bottomleft'><img src='".theme."images/blank.gif' width='6' height='7' alt='' style='display: block;' /></td>
<td class='bottommiddle'><img src='".theme."images/blank.gif' width='1' height='7' alt='' style='display: block;' /></td>
<td class='bottomright'><img src='".theme."images/blank.gif' width='6' height='7' alt='' style='display: block;' /></td>
</tr>
</table>
</div>

 

So if anyone got any suggestions ideas, please post ;)

 

//Cheers

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.