PHPÖ®smarty
smarty×÷ΪPHPµÄÄ£°å£¬ÊµÏÖÁËǰ̨ÃÀ¹¤Óëºǫ́Âß¼µÄ·ÖÀ롣ǰһ¶Îʱ¼ä¼òµ¥µØѧÁËһϣ¬°ÑÆä°²×°ÓÚÅäÖÃÒÔ¼°ÄÚ²¿µÄÓï·¨À´¼òµ¥×ܽáһϡ£È»ºóÒªÉè¼Æһϵç×ÓÉÌÎñϵͳ¡£
smartyѹËõ°ü½âѹºó£¬ÔÚlibsÎļþ¼ÐÏ£¬ÓÐ2¸öĿ¼ºÍ4¸öÎļþ£¬2¸öÎļþ¼Ð·Ö±ðÊÇinternalsºÍplugins£¬4¸öÎļþÒÀ´ÎÊÇdebug,smarty.class,config_file.class,smarty_compiler.class¡£Õâ2¸öĿ¼ºÍ4¸öÎļþÐèÒª¿½È밲װĿ¼¡£°²×°Íê³Éºó£¬ÐèÒª½¨Ò»¸ösmartyµÄÅäÖÃÎļþ£¬Ò»°ãÃüÃûΪsmarty_config.php,ÄÚ²¿´úÂëÐèÒª¶¨ÒåsmartyµÄ±àÒëĿ¼µÈµÈ¡£´úÂëÒ»°ãÈçÏÂ
<?php
¡¡¡¡include "class/Smarty.class.php";
¡¡¡¡define('__SITE_ROOT', 'd:/appserv/web/demo'); // ×îºóûÓÐбÏß
¡¡¡¡$tpl = new Smarty();
¡¡¡¡$tpl->template_dir = __SITE_ROOT . "/templates/";
¡¡¡¡$tpl->compile_dir = __SITE_ROOT . "/templates_c/";
¡¡¡¡$tpl->config_dir = __SITE_ROOT . "/configs/";
¡¡¡¡$tpl->cache_dir = __SITE_ROOT . "/cache/";
¡¡¡¡$tpl->left_delimiter = '<{';
¡¡¡¡$tpl->right_delimiter = '}>';
¡¡¡¡?>
°üÀ¨ÉèÖÃÄ£°åĿ¼£¬±àÒëĿ¼£¬×óÓÒ·Ö¸ô·ûµÈµÈ¡£
Ïà¹ØÎĵµ£º
define("DB_SERVER","127.0.0.1");
define("DB_PORT",3306);
define("DB_CATALOG","uab");
define("DB_USERID","root");
define("DB_PASSWORD","");
$dsn="mysql:host=".DB_SERVER.";port=".DB_PORT.";dbname=".DB_CATALOG;
self::$__PDO=new PDO($dsn, DB_USERID, DB_PASSWORD);
//support long connection
self:: ......
ÍøÉÏ¿´ÁËsession.save_pathºÃÏñÕâ¸ösessionÎÒ»¹Ã»ÓÐÔõôÓùýÄØ£¬¿´À´ÓбØÒªÑо¿Ò»Ï°¡
½ñÌìÌØÒâµÄ¿´ÁËÒ»ÏÂÎĵµ£¬¿´Ò»ÏÂÎĵµÈ·ÊµÓÐÕâô¶«Î÷£¬Ò²Ã»Óп´µ½Ê²Ã´Àý×Ó¾Í×Ô¼ºËæ±ãµÄдÁËÒ»µã¿´¿´
´úÂëÈçÏ echo session.save_path
´ò¿ªä¯ÀÀÆ÷²é¿´¾¹È»ÏÔʾ sessionsave_path ²»¶Ô°¡£¬Ôõô»áÊÇÕâ¸öÄØ£¬¿´¿ ......
<?php
$start = ip2long('192.168.1.1');
$start = sprintf("%u", $start) ;
$end = ip2long('192.168.1.50');
$end = sprintf("%u", $end) ;
for ($start; $start<$end; $start++){
echo long2ip($start)."<br>";
}
?> ......
ÒòΪ×î½ü×öÒ»¸öDIYµÄÉè¼ÆÆ÷£¬ÐèÒªÈÃÓû§Ñ¡Ôñij¸ö×ÖÌ壬²¢ÇÒÖ§³ÖÐýת£¬ÍÏÀµÈ²Ù×÷¡£Ö±½ÓʹÓÃÎı¾¿òÊDz»Ðеģ¬ÒòΪflex²»Ö§³Ö×ÖÌåµÄÖ±½ÓÐýת£¬´ó¼Ò¿ÉÒÔ³¢ÊÔһϣ¬Èç¹ûÑ¡ÔñÁËtext¿Ø¼þ£¬ÎÄ×־Ϳ´²»µ½ÁË£¬Óиö°ì·¨ÊÇ°ÑÎÄ×ÖembedǶÈëµ½swfÖÐÈ¥£¬ÕâÑù¾ÍÖ§³ÖÁË¡£
µ«ÊÇÓ¢ÎÄ»¹ºÃ£¬×ÖÌåÎļþ²»´ó£¬ÖÐÎĵĻ°¶¯éü¼¸¸öM£¬Õâ¸ö×ö·¨ºÜ²»ÏÖʵ ......