mysql_select_db("cms", $conn " /> 国产美女诱惑一区二区,亚洲日韩中文字幕,国产精品久久久久久免费观看

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php 使用GD庫為頁面增加水印示例代碼

復(fù)制代碼 代碼如下:
<?php
header ("Content-type: image/png");
$conn = MYSQL_connect("localhost", "root", ""); //連接數(shù)據(jù)庫
$colname_rs_article = $_GET['id']; //獲取參數(shù)id

mysql_select_db("cms", $conn); //執(zhí)行SQL
$query_rs_article = sprintf("SELECT * FROM articles WHERE article_id = %s", $colname_rs_article);
$rs_article = mysql_query($query_rs_article, $conn) or die(mysql_error());
$row_rs_article = mysql_fetch_assoc($rs_article);
$totalRows_rs_article = mysql_num_rows($rs_article);

$image = ImageCreateTrueColor(700, 1000); //創(chuàng)建畫布
$bg = ImageColorAllocate($image, 255, 255, 255); //設(shè)置背景為白色
ImageFill($image, 0, 0, $bg);
$text_color = ImageColorAllocate($image, 0, 0, 0); //設(shè)置文字顏色為黑色
imagestring($image, 5, 0, 0, $row_rs_article['title'], $text_color); //輸出文章標(biāo)題
imagestring($image, 3, 0, 20, $row_rs_article['author'], $text_color); //輸出文章作者
imagestring($image, 4, 0, 60, $row_rs_article['content'], $text_color); //輸出文章內(nèi)容
$logo = ImageCreateFromPNG('logo.png'); //獲得水印圖片
$logoW = ImageSX($logo);
$logoH = ImageSY($logo);
ImageCopy($image, $logo, 0, 0, 0, 0, $logoW, $logoH); //合并文字圖片與水印圖片
ImageJPEG($image); // output to browser
ImageDestroy($logo);
ImageDestroy($image);
?>

php技術(shù)php 使用GD庫為頁面增加水印示例代碼,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 隆子县| 普陀区| 台南市| 手机| 讷河市| 都江堰市| 镇沅| 民乐县| 分宜县| 太白县| 武川县| 获嘉县| 绥宁县| 郸城县| 曲阜市| 永兴县| 满洲里市| 荥阳市| 民权县| 新龙县| 莱州市| 陵川县| 凤山县| 乾安县| 左贡县| 壶关县| 颍上县| 平武县| 枣强县| 抚顺县| 中山市| 湖州市| 东至县| 平阴县| 沅江市| 福泉市| 兴化市| 探索| 宁陵县| 阜城县| 六枝特区|