想要我怎样才能将我想要的图像天气放置

时间:2014-09-02 08:50:03

标签: php image image-uploading

我想让我的文本编辑器完全正常运行,就像我希望通过CMS天气放置我的图像,我想要在段落之后或任何我想要的地方。

<?php
include('includes/db.php');
if (isset($_POST['submit']))
{
    $post_title = $_POST['title'];
    $post_date = date('d-m-y');
    $post_author = $_POST['author'];
    $post_keywords = $_POST['keywords'];
    $post_content = $_POST['content'];
    $post_book = $_FILES['image']['name'];
    $tmp_image = $_FILES['image']['tmp_name'];

    if ($post_title == '' || $post_author == '' || $post_keywords == '' || $post_content == '') {
        echo "<script>alert('Anyone field is empty')</script>";

        exit();
    } else {

        move_uploaded_file($tmp_image, "../e-books/$post_book");


        $insert_query = "insert into post (p_title,p_date,p_author,p_image,p_keywords,p_content) values ('$post_title','$post_date','$post_author','$post_book','$post_keywords','$post_content')";

        if (mysql_query($insert_query)) {

            echo "<script>window.open('insert_post.php?posted=Post is going to be published....!!!','_self')</script>";

            exit();
        }
    }
}
?>

1 个答案:

答案 0 :(得分:0)

您可以使用富文本编辑器并将上传文件与远程服务器功能集成。

例如CKEditor的集成版本; CKFinderTinymce