pavmoxo
05-13-2006, 10:48 AM
I have the next code to convert php for txt:
<?php
if($_POST["phptohtml"] != "")
{
// Open a script file
$File = "http://10.0.0.9/cm-lousa.pt/2.0/newsletter/newstotxt.php";
//Open the file $File
$FileOpen = fopen($File, "r");
// Init Contain
$Contain ="";
//Create the ouptut file (temp.html as example)
touch("temphtml/news.txt");
//Open the file on "append" mode
$Add = fopen("temphtml/news.txt","a");
//Fill Contain
while (!feof($FileOpen))
{
$Contain .= fread($FileOpen, 8192);
}
//Fill temp.html
fwrite($Add,$Contain);
//Close
fclose ($FileOpen);
fclose ($Add);
}
?>
and wan't to put the content of a php file into a DB field!! How can I do this?? It's possible?
<?php
if($_POST["phptohtml"] != "")
{
// Open a script file
$File = "http://10.0.0.9/cm-lousa.pt/2.0/newsletter/newstotxt.php";
//Open the file $File
$FileOpen = fopen($File, "r");
// Init Contain
$Contain ="";
//Create the ouptut file (temp.html as example)
touch("temphtml/news.txt");
//Open the file on "append" mode
$Add = fopen("temphtml/news.txt","a");
//Fill Contain
while (!feof($FileOpen))
{
$Contain .= fread($FileOpen, 8192);
}
//Fill temp.html
fwrite($Add,$Contain);
//Close
fclose ($FileOpen);
fclose ($Add);
}
?>
and wan't to put the content of a php file into a DB field!! How can I do this?? It's possible?