Modify File Example


[h:]
<?php
$file='filename.php';
$before='die(\'ERROR: Source form does not exist<script>alert("ERROR: Source form does not exist")</script>\')';
$after='//die( \'ERROR: Source form does not exist<script>alert("ERROR: Source form does not exist")</script>\')';
modfile($file,$before,$after);

$file='u5admin/filename.php';
$before="alert(\\'You have defined ";
$after="//alert(\\' You have defined ";
modfile($file,$before,$after);

////////////////////////////////////////////////////////////////////////////////////
function modfile($file,$before,$after) {
$c=file_get_contents($file);
if(strpos($c,$before)>0){
$c=str_replace($before,$after,$c);
file_put_contents($file,$c);
$c=file_get_contents($file);
if(strpos($c,$before)>0)echo"<script>alert('Server cannot modify $file')</script>";
if(strpos($c,$after)<1)echo"<script>alert('Server cannot modify $file')</script>";
}
}
?>
[h:]

Embedding

<iframe src="u5sys.content.php?c=modify" style="display:none"></iframe>



Check PHP Example

Download

Content Management System u5CMS

Service

English⇄German Translation Service

Blumen

blumen-bern-maarsen.ch