Time of Update: 2017-01-13
<?php/*注重:需要gd庫支援,需要iconv支援(php5已經包含不用載入)在圖片中添加中文文字*//*param $image 圖象資源param size 字型大小param angle 字型輸出角度param showX 輸出位置x座標param showY 輸出位置y座標param font 字型檔位置param content 要在圖片裡顯示的內容*/class showChinaText{var $text='你好';var $font='fs.ttf';var
Time of Update: 2017-01-13
實在不敢說是在這裡“講”GD庫,因為我用GD也才一兩次而已,絕大多數的函數還沒有接觸到。可是三斑竹小刁熱情地向我約稿,我只好硬著頭皮寫一點自己的心得。希望能夠起到拋磚引玉的效果。 其實,我們在web頁面裡實現“圖”的效果不一定非用GD不可,比較容易解決的是柱狀圖——用HTML就可以解決。比如:<? $b = array(150,110,125,180,160,175,230,220); ?>
Time of Update: 2017-01-13
到前面為止,我們已經能夠用GD完成作圖基本的需要了。但有的時候恐怕就要嫌ImageString 能用的五種字型少而且難看,那就要用到下面的函數了。這個函數允許我們使用TTF字型;但你必須擁有這些字型的檔案。<?php Header("Content-type: image/png"); $im = ImageCreate(400,
Time of Update: 2017-01-13
代碼如下複製代碼 $directory = 'gallery';$allowed_types=array('jpg','jpeg','gif','png');$file_parts=array();$ext='';$title='';$i=0;$dir_handle = @opendir($directory) or die("there is an error with your image directory!");while ($file =
Time of Update: 2017-01-13
copyright : smart-info limited. all right reserved. author : jacky cheung version : 1.1 create date : 24 september 2008 last modify : 15 march 2009*/class gd{
Time of Update: 2017-01-13
代碼如下複製代碼 session_start();$im=imagecreatetruecolor(100,30);//分配顏色$bg=imagecolorallocate($im,0,0,0);$textcolor=imagecolorallocate($im,255,255,255);//在圖片上劃線for($i=0;$i<3;$i++){$te1 = imagecolorallocate($im,rand(0,255),rand(0,255),rand(0,255)
Time of Update: 2017-01-13
有3個檔案:authcode.php-----驗證碼的產生php檔案authcode.html-----前台顯示頁面dealauthcode.php-----ajax提交到的幕後處理判斷驗證碼是否正確的處理頁面*/?>前台調用驗證碼代碼 代碼如下複製代碼 <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1
Time of Update: 2017-01-13
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta
Time of Update: 2017-01-13
代碼如下複製代碼 class image{ public $filename; private $info; private
Time of Update: 2017-01-13
*/ 代碼如下複製代碼 class cd_barra{ var $file; var $into; var $cd_barras =
Time of Update: 2017-01-13
代碼如下複製代碼 $image=$_get[id];$im=getimagesize($image);//print_r($im);//以下是讀取文字的寬高$font='verdana.ttf';//字型$font_size = $im[0]/20;//文字大小$size=imagettfbbox($font_size,0,$font,'111cn.net');//文字寬高$textwidth = $size [4];//取出寬$textheight = abs( $size
Time of Update: 2017-01-13
<?phprequire_once("../dbconnect.php");$proimagepath="photo/";$product_id=$_POST["product_id"];$product_pid=$_POST["product_pid"];$product_title=$_POST["product_title"];$product_name=$_POST["pr
Time of Update: 2017-01-13
php圖片驗證碼<?php//FileName:authimg.php//Description://Creater:alvar//Createtime:2006-5-4//Lastmodtime:session_start();?><?php //產生驗證碼圖片 Header("Content-type: image/PNG");
Time of Update: 2017-01-13
開始研究gvim的設定檔(_vimrc), 現在給大家看一下我產生亂碼之前的配置設定檔裡enconding,fileeconding,fileecondings的含義: encoding: gvim 內部使用的字元編碼方式,包括 vim 的 buffer (緩衝區)、菜單文本、訊息文本等。 使用者手冊上建議只在 .vimrc 中改變它的值,事實上似乎也只有在 .vimrc 中改變它的值才有意義。 fileencoding: gvim 中當前編輯的檔案的字元編碼方式,vim
Time of Update: 2017-01-13
1、假設充許連結圖片的主機網域名稱為:www.111cn.net2、修改httpd.conf SetEnvIfNoCase Referer "^http://www.111cn.net/" local_ref=1 <FilesMatch ".(gif|jpg)"> Order Allow,Deny Allow from env=local_ref </FilesMatch>
Time of Update: 2017-01-13
PHP 儘管提供了大量有用的函數,但是在特殊情況下還可能需要進行擴充編程,比如大量的 PECL(PHP Extension Community Library)就是以擴充的形式提供的(動態連結程式庫dll檔案),它們比 PEAR 的運行效率要高很多。 PHP 擴充是用 C 或 C++ 編寫的,需要編譯成動態串連庫 dll 檔案後在 PHP 環境下註冊後才能使用。 編寫 PHP
Time of Update: 2017-01-13
<?phpclass CreateHtml{ function mkdir( $prefix= ''''article'''' ) { $y = date(''''Y''''); $m = date(''''m''''); $d = date(''''d''''); $p=DIRECTORY_SEPARATOR; $filePath=''''article'''
Time of Update: 2017-01-13
<?phpclass conn{function __construct(){ require("config.php"); $conn = @mysql_connect($host,$root,$pass); @mysql_select_db($db); if(!$conn){ echo "無法串連".mysql_errno() . ":" . mysql_
Time of Update: 2017-01-13
實際上是毫無作用的函數了~因為現在的網域名稱商都很滑。很多網域名稱只要註冊了,就算不使用也會被預設指向一個網域名稱商的網址。所以即便探過去,都會返回一個200值。 = = 這也是沒辦法的事。 <?php$url = ''http://www.example.com'';print_r(get_headers($url));print_r(get_headers($url, 1));?> Array( [0] => HTTP/1.1 200 OK [1] =
Time of Update: 2017-01-13
本檔案可以用於自動建立目錄下所有JPG圖片的縮圖,放到圖片目錄下運行即可。缺點:長寬不一的圖片會被展開變形,不能智能裁切,需要智能裁切的,請自行研究。<?php $config = array(); $config[''path''] = "./"; $config[''t_width''] = 120; $config[''t_height''] = 98; $config[''ignore''] = array("",".",