Advertisement
terorama

dip / chat.php

Aug 21st, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1.  
  2. <?
  3.  
  4. print('<form action="chat.php" method="post" ENCTYPE="multipart/form-data">');
  5. print('<input type="text" name="senten" size="40">');
  6. print('<input type="file" name="pict">');
  7. print('<input type="submit" name="submit" value="say">');
  8. print('</form>');
  9.  
  10.  
  11. if (isset($submit)):
  12.   $file=fopen("chatpg.html", "r");
  13.   $data=fread($file,4000);  
  14.   fclose($file);
  15.  
  16.  
  17.   $file=fopen("chatpg.html", "w+");  
  18.   fputs($file,$senten.'<br>'); //Дописать строку в конец файла  
  19.  
  20.  if ($pict != "none")
  21.     {
  22.     copy($pict,"C:/Apache Group/Apache/htdocs/user/".$pict_name);
  23.     unlink($pict);     
  24.     fputs($file,'<img src="/user/'.$pict_name.'">');    
  25.     }
  26.  //endif   
  27.  
  28.  fputs($file,$data);
  29.  
  30. fclose($file);
  31.  
  32.  
  33.  
  34.  
  35.  
  36. endif;
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement