Location: PHPKode > projects > NewsP > thanks.php
<?
$jetzt =htmlentities($_POST["jetzt"]);
$ml_writer = $HTTP_POST_VARS["writer"]; 
$writer = htmlentities($ml_writer);
$com_t4 = htmlentities($HTTP_POST_VARS["com_t4"]); 
$kommentar = $HTTP_POST_VARS["kommentar"]; 
$gerds_nid = htmlentities($HTTP_POST_VARS["gerds_nid"]); 
$gerds_titel = $HTTP_POST_VARS["gerds_titel"]; 
$comdate = time();
$kommentar = stripslashes($kommentar);
$mailtxt = $kommentar;
$kommentar = htmlentities($kommentar);
$kommentar = urlencode($kommentar);
$jetzt = $jetzt+4;
$gestern = $comdate-86400;
if ($jetzt < $comdate && $gestern < $jetzt)
{
$amtfile = "admin/amt.txt";
$zaehlamt = fopen("$amtfile","r"); 
$inhalt_amtfile = fgets($zaehlamt);  
fclose($zaehlamt); 
$amts = unserialize($inhalt_amtfile);
$nid = "nid_$gerds_nid";
$check = $amts[$nid][com];
$ori_writer = $amts[$nid][ori_writer];

$www= $_SERVER['HTTP_HOST'];
$platz= $_SERVER['PHP_SELF'];
$ar_platz = explode('/',$platz);
$ar_dc1=count($ar_platz)-1;
unset ($ar_platz[$ar_dc1]);
$teil_link = implode('/',$ar_platz);
$referer = $_SERVER['HTTP_REFERER']; 

if($check=="102" || $check=="103")
{
$speicher = "settings/m_settings.txt";
$zaehlfile = fopen("$speicher","r"); 
$inhalt_zaehlfile = fgets($zaehlfile);  
fclose($zaehlfile); 
$intset = unserialize($inhalt_zaehlfile);
if ($intset[ml_com] == "checked")
{
$empfaenger = "$intset[mail]";
$ml_del4 = html_entity_decode($lg[ml_del4]);
$ml_del1 = html_entity_decode($lg[ml_del1]);
$ml_del2 = html_entity_decode($lg[ml_del2]);
$ml_del3 = html_entity_decode($lg[ml_del3]);
$ml_foot = html_entity_decode($lg[ml_foot]);

$betreff = "New coment on: $gerds_titel";
$from = "From: PHP NewsP <$empfaenger>";
$text = "$ml_writer wrote on $referer \n\n$mailtxt \n\nRegards PHP-NewsP";
mail($empfaenger, $betreff, $text, $from);
}

$nc="nc.txt";
if(file_exists($nc)){
$ticketfile = fopen("$nc","r+");}else{$ticketfile = fopen("$nc","w+"); }
$gerds_nc = fgets($ticketfile); 
if($gerds_nc <= 1000000){$gerds_nc=1000000;}
$gerds_nc++; 
rewind($ticketfile); 
fwrite($ticketfile, $gerds_nc); 
fclose($ticketfile);

if($check =="103"){
$n_store = "coms/nid_$gerds_nid.txt";
}else{
$n_store = "coms/meldung.txt";
}

if(file_exists($n_store)){
$n_file = fopen("$n_store","r+");}else{$n_tfile = fopen("$n_store","w+"); }
@$inhalt_n_file = fgets($n_file);  
@fclose($n_file); 
$coms = unserialize($inhalt_n_file);
$coms[$gerds_nc][date] =$comdate;
$coms[$gerds_nc][ori_writer] =$ori_writer;
$coms[$gerds_nc][gerds_nc] =$gerds_nc;
$coms[$gerds_nc][writer] =$writer;
$coms[$gerds_nc][kommentar] =$kommentar;


if($check=="102"){
$coms[$gerds_nc][nid] =$gerds_nid;
}

$loglink = serialize($coms);
$loglinkfile = "$n_store";
$logger = fopen("$loglinkfile","w"); 
fputs($logger, $loglink); 
fclose($logger); 

##################################
$fp = fopen("templates/p1.txt", "r");
$current_line = fgets($fp);
$dasfile = $current_line;
while (!feof($fp)) {
  $current_line = fgets($fp);
 $dasfile .= $current_line;
}
fclose($fp);
$dasfile = str_replace("<-nb-titel->", "Submitted", $dasfile);
$dasfile = str_replace("<-nb-linkblock->", '', $dasfile);
$dasfile = str_replace("<-nb-date->", '', $dasfile);
$dasfile = str_replace("<-nb-headline->", 'Submitted', $dasfile);
$dasfile = str_replace("<-nb-newstext->", "$com_t4", $dasfile);
$dasfile = str_replace("<-nb-writer->", '', $dasfile);
$dasfile = str_replace("<-nb-meta->", '', $dasfile);

eval("?>" . $dasfile . "<?"); 
}}


?>
Return current item: NewsP