——phpͼÏñ´¦ÀíÀà
<?
* +-------------------------------------------------------------+
* | Copyright (c) 2008-2009 Diqiye.Com All rights reserved.
* +-------------------------------------------------------------+
* | Info : ͼÏñ´¦ÀíÀà
* +-------------------------------------------------------------+
*/
class image {
// µ±Ç°Í¼Æ¬
protected $img;
// ͼÏñtypes ¶ÔÓ¦±í
protected $types = array(
1 => 'gif',
2 => 'jpg',
3 => 'png',
6 => 'bmp'
);
// image
public function __construct($img=''){
!$img && $this->param($img);
}
// Info
public function param($img){
$this->img = $img;
return $this;
}
// imageInfo
public function getImageInfo($img){
$info = @getimagesize($img);
if(isset($this->types[$info[2]])){
$info['ext'] = $info['type'] = $this->types[$info[2]];
} else{
$info['ext'] = $info['type'] = 'jpg';
}
$info['type'] == 'jpg' && $info['type'] = 'jpeg';
$info['size'] = @filesize($img);
return $info;
}
// thumb(ÐÂͼµØÖ·, ¿í, ¸ß, ²Ã¼ô, ÔÊÐí·Å´ó)
public function thumb($filename,$new_w=160,$new_h=120,$cut=0,$big=0){
// »ñÈ¡ÔͼÐÅÏ¢
$info = $this->getImageInfo($this->img);
if(!empty($info[0])) {
$old_w = $info[0];
$old_h = $info[1];
$type = $info['type'];
$ext = $info['ext'];
unset($info);
// Èç¹ûÔͼ±ÈËõÂÔͼС ²¢ÇÒ²»ÔÊÐí·Å´ó
if($old_w < $new_h &a
Ïà¹ØÎĵµ£º
1. ¾¡Á¿²ÉÓôóÁ¿µÄPHPÄÚÖú¯Êý¡£
2. echo ±È print ¿ì¡£
3. ²»Òª°Ñ·½·¨Ï¸·ÖµÃ¹ý¶à£¬×ÐϸÏëÏëÄãÕæÕý´òËãÖØÓõÄÊÇÄÄЩ´úÂ룿
4. ÔÚÖ´ÐÐforÑ»·Ö®Ç°È·¶¨×î´óÑ»·Êý£¬²»ÒªÃ¿Ñ»·Ò»´Î¶¼¼ÆËã×î´óÖµ¡£
5. ×¢ÏúÄÇЩ²»ÓõıäÁ¿ÓÈÆäÊÇ´óÊý×飬ÒÔ±ãÊÍ·ÅÄÚ´æ¡£
6. ²¢·ÇÒªÓÃÀàʵÏÖËùÓеÄÊý¾Ý½á¹¹£¬Êý×éÒ²ºÜÓÐÓá£
7. $row['id']µÄÐ ......
Êý¾Ý¿âÉè¼Æ£º
--
-- Êý¾Ý¿â: `test`
--
-- --------------------------------------------------------
--
-- ±íµÄ½á¹¹ `menu`
--
CREATE TABLE IF NOT EXISTS `menu` (
`ID` int(10) unsigned NOT NULL auto_increment,
`PID` int(11) NOT NULL,
`TITLE` varchar(200) NOT NULL,
`REMARK` varchar(200) NOT ......
ÕâÁ½ÌìÒ»Ö±ÔÚ°ïÈË×ö¸öÈí¼þ¿ÉÊÇ°³Ö»»áÓÃphp£¬php³ÌÐòµÄÔËÐÐÊÇ»ùÓÚApache·þÎñÆ÷µÄ£¬Ã»°ì·¨ ÒªÔËÐгÌÐò¾Í±ØÐëÔËÐзþÎñÆ÷Apache·þÎñÆ÷¿ÉÒÔÑ¡ÓÃ×é×°°æµÄ£¬ÏÂÃæ·ÖÏíÏÂÎÒµÄÅäÖ÷½·¨£¬ÓÃÒ»¸öСµÄÅú´¦Àí³ÌÐò¾Í¿ÉÒÔÍê³É¡£
ÏÂÃæ¾ÍÊÇÎÒµÄÅú´¦Àí³ÌÐò£º
@ ECHO OFF
copy d:\road\httpd-vhosts.conf c:\xampp\apache\conf\extra / ......
phpµ÷ÓÃoracleÐд洢¹ý³Ì############################################################
PHP³ÌÐò·ÃÎÊÊý¾Ý¿â£¬ÍêÈ«¿ÉÒÔʹÓô洢¹ý³Ì£¬ÓÐÈËÈÏΪʹÓô洢¹ý³Ì±ãÓÚά»¤
²»¹ýÈÊÕß¼ûÈÊ£¬ÖÇÕß¼ûÖÇ¡£
ÔÚÕâ¸öÎÊÌâÉÏ£¬Å¼ÈÏΪʹÓô洢¹ý³ÌÒâζ×űØÐëÒªDBAºÍ¿ª·¢ÈËÔ±¸ü½ôÃÜÅäºÏ,Èç¹ûÆäÖÐÒ»·½¸ü±ä£¬ÔòÏÔÈ»ÄÑÒÔά»¤¡£
µ«ÊÇʹÓô洢 ......
PhpÁ¬½ÓmysqlµÄº¯ÊýÈçÏ£º
mysql_connect("Ö÷»úÃû","Óû§Ãû","ÃÜÂë");//´ò¿ªÒ»¸öÁ¬½Ó
mysql_select_db("´ò¿ªÊý¾Ý¿â",Á¬½Ó±êʶ·û);//´ò¿ªÒ»¸öÊý¾Ý¿â
$conn=@mysql_connect("localhost","root","") or die("Á´½Ó´íÎó");ÕâÀï@¿ÉÒÔÒþ²Ø´íÎóÌáʾ,or die¿ÉÒÔÔÚ´íÎóµÄʱºòÏÔʾ¡£
Ö´ÐÐsqlÓï¾äµÄº¯Êý:
mysql_query();
$sql= ......