Monday, January 27, 2014

Modif html file content

$title=stripslashes($_POST['title']);
$unit=stripslashes($_POST['unit']);
$isi=stripslashes($_POST['setatus']);
copy("berita_new.html", "../berita/berita_new.html");
rename ("../berita/berita_new.html", "../berita/".$title.".html");
// create file pointer 
$fp = @fopen('../berita/'.$title.'.html', 'w') or die('Could not open file, or fike does not exist and failed to create.');

$mytext = $isi;

// write text to file
@fwrite($fp, $mytext) or die('Could not write to file.');
// close file
@fclose($fp);

echo "<meta http-equiv='refresh' content='0; url=../berita/".$title.".html'>";

No comments:

Post a Comment