Просмотр файла blackgbs/postedit.php

Размер файла: 763B
  1. <?php
  2. include "config.php";
  3. if ($pass==$user_pass)
  4. {
  5. $page=$_POST['page'];
  6. $str=$_POST['str'];
  7. $file=file("./msg/$id.dat");
  8. $editstr=trim($file[$str]);
  9. $ex=explode('||',$editstr);
  10. $name_user=trim($ex[0]);
  11. $browser=trim($ex[1]);
  12. $ip=trim($ex[2]);
  13. $time=trim($ex[3]);
  14. $msg=$_POST['msg'];
  15. $otvet=$_POST['otvet'];
  16. $msg=str_replace("\r\n","<br/>",$msg);
  17. $otvet=str_replace("\r\n","<br/>",$otvet);
  18. $buff=file_get_contents("./msg/$id.dat");
  19. $buff =str_replace("$editstr","$name_user||$browser||$ip||$time||$msg||$otvet||",$buff);
  20. $fileed = fopen("./msg/$id.dat","w");
  21. fputs($fileed,"$buff");
  22. fclose($fileed);
  23. }
  24. $site='http://'.$_SERVER['HTTP_HOST'].''.str_replace('postedit.php','index.php',$_SERVER['PHP_SELF']).'?id='.$id.'&page='.$page;
  25. header ("Location: $site");
  26. ?>