Jump to content

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


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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