[PHP]SmartyµÄʹÓÃ
<?php
define('SMARTY_TMP_DIR','C:/php5/Smarty-2.6.13/');
define('SMARTY_DIR','C:/php5/Smarty-2.6.13/libs/'); //SMARTY_DIR ->smarty keyword,must be defined as libs dectory
require_once(SMARTY_DIR.'Smarty.class.php');
//½¨Á¢Ò»¸ösmarty¶ÔÏó
$smarty = new Smarty;
$smarty->template_dir = SMARTY_TMP_DIR.'templates/';
$smarty->compile_dir = SMARTY_TMP_DIR.'templates_c/';
$smarty->config_dir = SMARTY_TMP_DIR.'configs/';
$smarty->cache_dir = SMARTY_TMP_DIR.'cache/';
//$smarty->left_delimiter = '{/';
//$smarty->right_delimiter = '/}';
//----------simple show example------------
//$smarty->assign('name','Porky');
//$smarty->display('smarty_test.tpl');
?>
Ïà¹ØÎĵµ£º
1£ºint strposº¯ÊýµÄ×÷ÓúÍCÓïÑÔÖеÄchar *strstr()Ò»Ñù
2£ºhtmlspecialchars()£¬½«ÌØÊâ×Ö·ûת»¯ÎªHTMLʵÌå(entity)
3£ºPHPÖ÷ÒªÓÃÓÚÒÔÏÂÈý¸öÁìÓò£º
1>£º·þÎñÆ÷¶Ë½Å±¾ 2>£ºÃüÁîÐнű¾ 3>£º±àд×ÀÃæÓ¦ÓóÌÐò
4£ºphp²¢ÖÃÔËËã·û(.)½«Á½¸ö×Ö·û´®Á¬½ÓÆðÀ´
5£ºphpµÄ×¢ÊͺÍCÓïÑÔµÄ×¢ÊÍÒ»Ñù¡ ......
¶¨ÒåºÍÓ÷¨
htmlspecialchars() º¯Êý°ÑһЩԤ¶¨ÒåµÄ×Ö·ûת»»Îª HTML ʵÌå¡£
Ô¤¶¨ÒåµÄ×Ö·ûÊÇ£º
& £¨ºÍºÅ£© ³ÉΪ &
" £¨Ë«ÒýºÅ£© ³ÉΪ "
' £¨µ¥ÒýºÅ£© ³ÉΪ '
< £¨Ð¡ÓÚ£© ³ÉΪ <
> £¨´óÓÚ£© ³ÉΪ >
Óï·¨
htmlspecialchars(string,quotestyle,character-se ......
ÏÂÃæ½éÉܼ¸ÖÖPHPÖÐÅжϡ¢Ñ»·µÄ¼¸ÖÖд·¨¡£
×îÆÕͨµÄÅжϣº
<?php
if( $args != NULL )
{
call_func($args);
}
?>
¶ÔÓÚµ¥ÐеÄÖ´ÐÐÓï¾ä£¬¿ÉÒÔд³É£º
<?php
if( $args != NULL ) call_func($args);
?>
Ò²¿ÉÒÔʹÓÃÒýºÅµÄ·½Ê½¡£
<?php
if( $args != NULL ):
call_func($args);
......
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type = "text/css">
&nbs ......