Advertisement
Guest User

Untitled

a guest
Jun 18th, 2013
12,229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. <?php
  2.     $callback = $_GET['CKEditorFuncNum'];
  3.     $file_name = $_FILES['upload']['name'];
  4.     $file_name_tmp = $_FILES['upload']['tmp_name'];
  5.     $file_new_name = '/var/www/ckeditortest/upload/';
  6.     $full_path = $file_new_name.$file_name;
  7.     $http_path = '/upload/'.$file_name;
  8.     $error = '';
  9.     if( move_uploaded_file($file_name_tmp, $full_path) ) {
  10.     } else {
  11.      $error = 'Some error occured please try again later';
  12.      $http_path = '';
  13.     }
  14.     echo "<script type=\"text/javascript\">window.parent.CKEDITOR.tools.callFunction(".$callback.",  \"".$http_path."\", \"".$error."\" );</script>";
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement