function store_text_content($relative_script_path,$spider_id,$text,$ftp_id='')
{
if (CONTENT_TEXT == 1)
{
reset($text);
while (list($n_chunk,$text_to_store) = each($text))
$temp=wordwrap($text_to_store);
$query = "INSERT INTO text_content ( spider_id , text_content ) VALUES ('$spider_id', '$temp')";
mysql_query($query);
}
else print "Warning : Unable to create the content entry....";
return $ftp_id;
}
below is the original code above code is what i want can anyone tell me why its not working?
function store_text_content($relative_script_path,$spider_id,$text,$ftp_id='')
{
if (CONTENT_TEXT == 1)
{
$file_text_path = $relative_script_path.'/'.TEXT_CONTENT_PATH.$spider_id.'.txt';
if ($f_handler = @fopen($file_text_path,'a'))
{
reset($text);
while (list($n_chunk,$text_to_store) = each($text))
fputs($f_handler,wordwrap($text_to_store));
fclose($f_handler);
//here the ftp case
if (FTP_ENABLE)
{
$ftp_id = phpdig_ftp_keepalive($ftp_id);
@ftp_delete($ftp_id,$spider_id.'.txt');
ftp_put($ftp_id,$spider_id.'.txt',$file_text_path,FTP_ASCII);
}
}
else
print "Warning : Unable to create the content file $file_text_path ! $br";
}
return $ftp_id;
}