Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

phpÄ£°å¼¼Êõ

Õ¾µã½á¹¹

´úÂë:
Õ¾µã
  ©»includes
       ©»class.inc
  ©Çtemplet
       ©»index.htm
       ©Çlist.htm
       ©»content.htm
  ©Çindex.php
  ©»content.php
¿â½á¹¹

´úÂë:
-- Êý¾Ý¿â: `test`
-- ±íµÄ½á¹¹ `test`
CREATE TABLE `test` (
  `id` smallint(3) NOT NULL auto_increment,
  `name` varchar(10) NOT NULL default '',
  `sex` enum('ÄÐ','Å®') NOT NULL default 'ÄÐ',
  `age` smallint(2) NOT NULL default '0',
  `email` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
--------------- class.incÎļþ --------
CODE:
<?
php 
 
class 
mycon
{  
    private 
$myhost

    private 
$myuser

    private 
$mypwd

    function 
mycon
(
$host
=
"localhost"
,
$user
=
"root"
,
$pwd
=
""
){ 
      
$this
->
myhost 

$host

      
$this
->
myuser 

$user

      
$this
->
mypwd 

$pwd

    } 
    function 
connect
(){ 
      return 
mysql_connect
(
$this
->
myhost
,
$this
->
myuser
,
$this
->
mypwd
); 
    } 
  } 

  class 
templet

     private 
$source_file

     function 
get_file
(
$filename
){ 
         
$


Ïà¹ØÎĵµ£º

phpÖÐ__FILE__³£Á¿Ó÷¨¼ò½é

1.phpÖеÄ__FILE__³£Á¿·µ»ØÎļþµÄÍêÕû·¾¶ºÍÎļþÃû.
2.dirname(__FILE___) º¯Êý·µ»ØµÄÊǽű¾ËùÔÚÔڵķ¾¶¡£
±ÈÈçÎļþ b.php °üº¬ÈçÏÂÄÚÈÝ£º
<?php
$basedir = dirname(__FILE__);
?>
Èç¹ûb.php±»ÆäËûĿ¼ÀïµÄa.phpÎļþrequire »òÕß include È¥ÒýÓõϰ¡£
±äÁ¿?$basedir µÄÄÚÈÝ»¹ÊÇb.phpËùÔÚµÄÄǸöÎļþ¼Ð ......

PHP·¢ËÍEmail Àà


 ¾­²âÊÔ  ûÓÐÎÊÌâ
<?
class smtp
{
/* Public Variables */
var $smtp_port;
var $time_out;
var $host_name;
var $log_file;
var $relay_host;
var $debug;
var $auth;
var $user;
var $pass;
/* Private Variables */
var $sock;
/* Constractor */
function smtp($relay_host = " ......

̽ÌÖPHP SQL×¢ÈëµÄ½â¾ö˼·

˼·:SQLÀᄀ¿ÉÄܵIJÉÓÃÁ½¸öÒýºÅ±ÕºÏ±äÁ¿;¶Ô±äÁ¿ÖеÄÒýºÅתÒå;¶Ô²»ÄܲÉÓÃ2¸öÒýºÅ±ÕºÏµÄ±äÁ¿,ÏÈÔ¤ÏÈÅжϱäÁ¿ÀàÐÍ;  
   
  ·½°¸:  
  1   ËùÓзÇÊýÖµÔËËã(Èç×Ö·û,¼òµ¥ÊýÖµÐ͵ȵÈ)µÄSQL±äÁ¿¶¼¼ÓÒýºÅ;  
  2   ËùÓзÇÊýÖµÔËËãµÄSQL±äÁ¿µÄÖµ¶¼²ÉÓÃmagic_quotes_gpc» ......

PHP µÄ×Ö·û´®±í´ïÈýÖÖ·½Ê½


µ¥ÒýºÅ
      $str = 'ÎÒÊÇһͷ´ó»ÒÀÇ';
Ë«ÒýºÅ
      $str2 = "ÄãÒ²ÊÇһͷ´ó»ÒÀÇ";
¶¨½ç·û
      $str3 = <<< DDD
          ¶¼ÊÇ´ó»ÒÀÇ£¬
   &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ