如何在图片上传中添加水印

时间:2017-01-11 21:42:43

标签: javascript php jquery html image

我想在PHP脚本中上传时在图像上添加水印。我在Google上发现了许多组件,但我不知道如何使用Dynamically add watermark on image upload,我不知道应该传递给组件函数添加水印的值。可以有人帮助我。

我的代码。

用于图片上传的HTML文件:

transform-exponentiation-operator

添加图片php:

<form action="" method="post" enctype="multipart/form-data" onsubmit="return checkValidation(this);">
<fieldset>
    <p>
        <label>Select Language:</label>

        <select name="language_id" id="language_id" style="width:280px; height:25px;">

            <option value="">--Select Language--</option>

            <?php 
               while($lang_row=mysql_fetch_array($lang_result)) {
    ?>

                <option value="<?php echo $lang_row['id'];?>">
                    <?php echo $lang_row['language_name'];?>
                </option>

            <?php
                }
            ?>
        </select>
    </p>
    <p>
        <label>Select Category:</label>

        <select name="category_id" id="category_id" style="width:280px; height:25px;">

            <option value="">--Select Category--</option>

        </select>
    </p>



    <p>
        <label>Quote:</label>
        <div class="wrapper">
            <p>
                <label>Image Quote:</label>
                <input type="file" name="img_quote[]" id="img_quote[]" class="text-long" />
            </p>
            <p>
                <label>Text Quote:</label>
                <textarea name="quote[]" id="quote[]" class="text-long"></textarea>
            </p>
        </div>
    </p>

    <p>
        <div id="dynamicInput"></div>
    </p>

    <p>
        <input type="button" value="Add another Quote" onClick="addInput('dynamicInput');">
    </p>

    <p>
        <input type="submit" name="submit" value="Add Quote" />
    </p>
</fieldset>
</form>

php函数文件

图片上传

<?php include("includes/header.php");

require("includes/function.php");
$kwallpaper=new  k_wallpaper;

mysql_query("SET NAMES 'utf8'");

//Get all Category 
$qry="SELECT * FROM tbl_category";
$result=mysql_query($qry);

//Get all Language
$lang_qry="SELECT * FROM tbl_language";
$lang_result=mysql_query($lang_qry); 

if(isset($_POST['submit']) and isset($_GET['add']))
{   

    $kwallpaper->addquote();

    echo "<script>document.location='manage_quotes.php';</script>"; 
    exit;

}   

?>

如何在我的脚本

上安装此Dynamically add watermark on image upload

0 个答案:

没有答案