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

php smarty»ù±¾Ê¹ÓÃ

1.»ù±¾Àà
//smarty_config.php
<?php
define('TEMPLATE_DIR','templates/');
define('COMPILE_DIR','templates_c/');
define('CONFIG_DIR','configs/');
define('CACHE_DIR','cache/');
?>
//View.class.php
<?php
//ÅäÖÃÎļþ
require_once 'configs/smart_config.php';
//SmartyÀà
require('smarty/Smarty.class.php');
class View extends Smarty {
function SmartyFactory() {
$this->Smarty();
//Ä£°å·¾¶
$this->template_dir = TEMPLATE_DIR;
//±àÒëºóÎļþ
$this->compile_dir = COMPILE_DIR;
//ÅäÖÃÎļþ
$this->config_dir = CONFIG_DIR;
//»º´æÎļþ
$this->cache_dir = CACHE_DIR;
$this->debugging = true;
}
//ÖØзâ×°display ¸öÈËÏ°¹ß¸Ä³Éshow
function show($name,$cacheId='') {
if($cacheId == '')
$this->display($name.'.htm');
else
$this->display($name.'.htm',$cacheId);
}
//ÖØзâ×°assign Ï°¹ßÓÃadd
function add($name,$value) {
$this->assign($name,$value);
}
}
?>
»ù±¾Ä¿Â¼Èç:
test
    |-configs
    |-templates
    |-templates_c
    |-cache
    |-smarty --smarty lib
2.»ù±¾Ê¹ÓÃ
//index.php
<?php
require_once('View.php');
//Êý¾Ý²éѯ mysql_fetch_assoc() ·µ»ØÊý×é
//Êý¾Ý¿â²ã·â×°
//Èç:$User = new User();
//$Users = $User->paging('²ÎÊý');
$View = new View();
$View->add("users",$Users);
$View->show("index");
?>
//public.conf
[public]
public = public/
img = public/img/
css = public/css/
js = public/js/
//index.htm --ÔÚtemplatesÎļþ¼ÐÏ ¼ò¶Ì½éÉÜÏÂ
<html>
<!-- °üº¬meta.htmÎļþ-->
{include file="meta.htm"}
<!-- ÀûÓÃsmarty configÎļþ ¶¨Òå»ù±¾ÐÅÏ¢-->
{config_load file=public.conf section="public"}
<!-- ÂÔ -->
<table>
 <tr>
  <!-- {#img#} imgµÄ»ù±¾Â·¾¶ ¶ÔÓÚÒ»°ãСÍøÕ¾µÄ×ö·¨ ÈçÓÐÊÇʹÓÃÁ˶þ¼¶ÓòÃûµÄ¾²Ì¬·þÎñÆ÷û±ØÒªÁË-->
  <td><input type="image" src="{#img#}xxx.gif"/></td>
 </tr>


Ïà¹ØÎĵµ£º

PHPÕûºÏFCKeditor


ÉùÃ÷£¬ÎÒÓõÄPHP¿ò¼ÜÊÇCI£¨codeignitor)£¬µ«ÆäʵÒòΪÊÇÓÃJSµ÷ÓÃFCKeditorµÄ£¬ËùÒÔÕâ¸öºÍ¿ò¼ÜûÓйØϵ
Ê×ÏÈÏÂÔØFCKeditor 2.6.3 £¨ÎÒʹÓõÄÊÇÕâ¸ö°æ±¾£©
¿ÉÒÔÔÚCSDNÖÐÏÂÔØ
½âѹ£¬½«FCKeditor2.6.3ÏÂÃæµÄfckeditorÕû¸öÎļþ¼Ð¸´ÖƵ½ÍøÕ¾¸ùĿ¼(ºÍindex.php£©Í¬Ò»¸öĿ¼£¬²¢¸üÃûΪfck£¨²»¸ÄÃûÒ²ÐУ¬µ«ºóÃæÉèÖøù·¾¶µÄʱºò ......

Äã¿ÉÒÔϲ»¶PHP£¬µ«ÊÇÄã²»ÄÜÈö»Ñ£¡

×î½üÎÒÕæÊÇÍ·´óÒÓ£¬ÎҵIJ©¿ÍÀï¾ÓȻһҹ¼ä±ä³ÉÁËphpºÍaspµÄ¶·Õù³¡£¬ÉõÖÁ±ä³ÉÁËwindowsºÍlinuxµÄ¶·Õù³¡¡£ÕæÊÇÒâÏë²»µ½µÄ¡£
ÎÒ±¾À´ÎÞÒâÌôÆðwindowsºÍlinuxÖ®¼äµÄÕù¶Ë£¬¶øÇÒÒ²·Ç³£²»ÏëÈ¥ÌôÕâÖÖÕù¶Ë¡£
»°Ëµ£¬ÆäʵÎÒ±¾Éí¶Ôlinux²Ù×÷ϵͳÊÇûÓÐʲô»µÓ¡ÏóµÄ£¬ËäÈ»×Ô¼ºµÄµçÄÔÉÏûÓÐ×°¹ýlinux£¬µ«ÊÇÔÚͬѧµÄµçÄÔÉÏÓùý£¬¾õµÃËüͦºÃ ......

phpʵÏÖCMSϵͳ¸öÈËÐĵÃ

    ×î½ü°ïʵÑéÊÒÍêÉÆÒ»¸öCMSϵͳ£¬ÏÖÔÚÒѾ­½øÈëβÉù£¬½è´Ë»ú»á¼òÒª¼Ç¼һÏÂʵÏÖµÄϸ½Ú£¬ÒÔ±¸ËùÐè¡£
±¾ÏµÍ³ÊǸö´¿´âµÄÔÚÏßÄÚÈݹÜÀíϵͳ£¬×îÖ÷ÒªµÄ²Ù×÷¾ÍÊÇÏòÊý¾Ý¿âÖÐÌí¼Ó¡¢Ð޸ĺÍɾ³ýÊý¾Ý£¬Ó¦¸Ã˵ʵÏÖÆðÀ´ºÜ¼òµ¥£¬²»¹ýÕýÊÇÒòΪ¼òµ¥£¬Ê¹µÃÔ­ÓÐϵͳÏԵúÜÄÑά»¤£¬¼òµ¥ÀàËƵIJÙ×÷ÓÐ20¶à¸ö²»Í¬µÄÒ³Ã棬ÿ¸öÒ³Ãæ ......

PHPÈçºÎ¶ÔSESSIONÐòÁл¯£¨SESSION¶ÔÏó´¦Àí£©

這個問題ÓÐ點Ææ¹Ö£¬ÔÚJavaºÍ.netµÄÊÀ½ç裡還δÅöµ½過.......
¿´來PHP對對ÏóµÄÖ§³Ö還²»ÊÇÌ«ÓѺ㬺ǺÇ~~~
[轉載춣º] http://blog.csdn.net/yehell/archive/2007/12/19/1953826.aspx
½ñÌìÔÚphpÎļþÖÐÉèÖÃÁËÒ»¸ösession.²¢½«Ò»¸öÀ ......

apache and php common tips and problems

When I deploy php application on apache, some problem come out, and solved. Here's the tips and problems solved.
0.How could I deploy an apache server armed with php, mysql, perl, and phpMyAdmin on the fly?
You need a package bundled with all these tools,  xampp shall meet you needs, you can ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ