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>
Ïà¹ØÎĵµ£º
1. ½èÓñðÈ˵ÄÓòÃû×÷¸¸ÓòÃû.
2. ½èÓô˿ռ佨Á¢Ò»phpÎļþ,´Ëphp¹¦ÄÜΪ,ÌṩµØÖ·À¸µÄij¸ö²ÎÊýʱ,¼ì²â´Ë²ÎÊý,ÕýÈ·,¾Í»ñÈ¡µ±Ç°µÄÔ¶³ÌipдÈëÒ»js.
3. ÆäËüÈË·ÃÎÊ´Ëphp,Ö±½Ó·ÃÎÊ,²¢Ã»ÓÐÌṩ²ÎÊý,ËùÒÔ,Ö±½ÓÔØÈëÉÏÃæµÄjs,¼´Ö±½ÓתÏòµ½Ô¶³Ìip,ÕâÑù¾Í´ïµ½ ¸üÐÂ/Ìø×ª¹¦ÄÜÁË.ͬʱ¿ÉÒÔÀûÓÃjsµÄimg onerrʼþ¼ì²âÔ¶³ÌipÊÇ·ñÕýÈ·, ......
ÉùÃ÷£¬ÎÒÓõÄPHP¿ò¼ÜÊÇCI£¨codeignitor)£¬µ«ÆäʵÒòΪÊÇÓÃJSµ÷ÓÃFCKeditorµÄ£¬ËùÒÔÕâ¸öºÍ¿ò¼ÜûÓйØÏµ
Ê×ÏÈÏÂÔØFCKeditor 2.6.3 £¨ÎÒʹÓõÄÊÇÕâ¸ö°æ±¾£©
¿ÉÒÔÔÚCSDNÖÐÏÂÔØ
½âѹ£¬½«FCKeditor2.6.3ÏÂÃæµÄfckeditorÕû¸öÎļþ¼Ð¸´ÖƵ½ÍøÕ¾¸ùĿ¼(ºÍindex.php£©Í¬Ò»¸öĿ¼£¬²¢¸üÃûΪfck£¨²»¸ÄÃûÒ²ÐУ¬µ«ºóÃæÉèÖøù·¾¶µÄʱºò ......
½ñÌì¸ãÁËÒ»ÏÂÎ磬ÔÚµçÄÔÉϴÁËAPMƽ̨
ϵͳ:Windows7 Professional EN
Apache2.2.9:http://archive.apache.org/dist/httpd/binaries/win32/apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi
PHP5.3.1:http://windows.php.net/downloads/releases/php-5.3.1-Win32-VC6-x86.zip
MySQL5.1.42:http://ftp.iij.ad.jp/pub/db/ ......
這個問題ÓÐ點Ææ¹Ö£¬ÔÚJavaºÍ.netµÄÊÀ½ç裡還δÅöµ½過.......
¿´來PHP對對ÏóµÄÖ§³Ö還²»ÊÇÌ«ÓѺ㬺ǺÇ~~~
[轉載ì¶£º] http://blog.csdn.net/yehell/archive/2007/12/19/1953826.aspx
½ñÌìÔÚphpÎļþÖÐÉèÖÃÁËÒ»¸ösession.²¢½«Ò»¸öÀ ......
import java.io.IOException;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class DES {
private byte ......