Got a small problem with a bit of code i am working on. I am reading a text file putting it to a temp file (the contents of it) then removing it to creat a fresh copy. Then i am adding the old content back and adding the new content to it also that was submited in the form, but the contents contain slashs which are messing up the page because the page reads the file and displays the contents in it.
I come out with this to strip the slashs but for some reason it wont work.
//now lets pull out the tmp data (old data)
$ctoaddtmp = file_get_contents("../DOCS/originalsLISTtmp.txt");
//$ctoaddorg = file_get_contents("../DOCS/originalsLIST.txt");
//now input the old data to the file
$myoldfile = "../DOCS/originalsLIST.txt";
$ctoadd3 = $ctoaddtmp . $displaytext;
$fhtmp = fopen($myoldfile, 'w') or die("can't open file");
It just does nothing, the slashes remain there and wont move, could someone please point me in the right direction! Thanks