please help, details in comments !
### i try to delete some entrys from a script, and write them. unforunately it
###deletes the whole file - is this the W+ and not adding $deleted_content.
###thanks for your time!
//log file
<?php
$title[] = "<a href='file_url'>test</a>";
$file[] = "test.gif";
$size[] = "0";
$owner[] = "m4rine";
$date[] = "10th May 2004 - 11:01";
$filepath[] = "downloads/test.gif";
?>
//end this file
// this is the script to get rid of the filke data in above
// predume $HTTP_GET_VARS['file'] = downloads/test.gif
if( isset($HTTP_GET_VARS['file']) )
{
$filename = "downloads/downloads.php";
$fileopen = fopen( $filename, "r" );
$filesize = filesize( $filename );
$fileread = fread( $file, $filesize );
fclose( $fileopen );
$file = $HTTP_GET_VARS['file'];
$deleted_content = eregi_replace( '<\?php
\$title\[\] = "<a href=\'\$file\'>.*</a>";
\$file\[\] = ".*";
\$size\[\] = ".*";
\$owner\[\] = ".*";
\$date\[\] = ".*";
\$filepath\[\] = "\$file";
\?>', '', $fileread );
$fileopen = fopen( $filename, "w+" );
echo("$deleted_content");
fwrite( $file, $deleted_content );
fclose( $fileopen );
//End
any help would be much apprieciated, thanks for you time! 😃