[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');
?>
Ïà¹ØÎĵµ£º
¿ªÔ´½¨Õ¾³ÌÐòÈñà³Ì¸ßÊÖºÍÖ»¶®´ò×ÖÉÏÍøµÄÈ˶¼¿ÉÒÔ¿ìËÙ½¨Á¢Ò»¸ö¹¦ÄÜÇ¿´ó¡¢½çÃæÆ¯ÁÁµÄÍøÕ¾¡£²»¹ÜÄãÊÇÏ뽨һ¸ö²©¿Í¡¢ÂÛ̳¡¢CMS¡¢µç×ÓÉÌÎñÍøÕ¾£¬»òÊÇWiki¡¢Ïà²á¹ÜÀí¡¢RSS¾ÛºÏºÍÀàDiggÍøÕ¾¡£Äã¶¼¿ÉÒÔͨ¹ýÕâЩ½¨Õ¾¹¤¾ß¿ìËÙ½¨Á¢¡£
ÎÒÃÇ֮ǰ½éÉܹý23¸ö¿ªÔ´µÄCMS¹ÜÀíϵͳ£¬ÏÖÔÚÔòÈÃÎÒÃÇÀ´¿´Ò»ÏÂ26¿î¿ªÔ´½¨Õ¾³ÌÐò¡£
¹úÍâPHP¿ªÔ´½¨ ......
1. $_GET
£º
http://localhost/a.php?a=ok
<?
echo
$_GET['a']; //ÏÔʾ"ok"
?>
2. $_SERVER['QUERY_STRING']
http://localhost/a.php?a=1&b=2&c=3
......
1 PHPÖе¥ÒýºÅÓëË«ÒýºÅµÄÇø±ð
¡¡¡¡ÔÚPHPÖУ¬Í¨³£Ò»¸ö×Ö·û´®±»¶¨ÒåÔÚÒ»¶ÔÒýºÅÖУ¬È磺
'I am a string in single quotes'
"I am a string in double quotes"
¡¡¡¡PHPÓï·¨·ÖÎöÆ÷ÊÇÓóɶԵÄÒýºÅÀ´ÅжÏÒ»¸ö×Ö·û´®µÄ¡£Òò´Ë£¬ËùÓÐ×Ö·û´®±ØÐëʹÓÃͬһÖÖµ¥»òÕßË«
ÒýºÅÀ´¶¨Ò忪ʼºÍ½áÊø¡£ÀýÈ磬ÏÂÃæµÄ×Ö´®¶¨ÒåÊ ......
<?php
header("Content-Type:image/png");
srand((double)microtime()*1000000);
$img_height=20;
$img_width=60;
$im=@imagecreate($img_width,$img_height) or die("²»Äܳõʼ»¯GDÎļþÁ÷");
$background_color=imagecolorallocate($im,255,255,255);
$text_color=imagecolorallocate($im,233,14,91);
......
1. °²×°php5.1ÒÔÉϵİ汾,ÓÐÖ§³Öpdo!ΪÁËʹÄãµÄ»·¾³ÄÜÌṩ¶ÔpdoµÄÖ§³Ö!ÔÚphp.iniÎļþ¼ÓÈëÒÔÏÂ:
extension=php_pdo.dll
extension=php_pdo_mysql.dll
extension=php_pdo_mssql.dll(Ö§³ÖmssqlÊý¾Ý¿â)
2. ÒÔÏÂΪPHÖÐPDOµÄ¾ßÌåʹÓÃ
<?php
$dsn = 'mysql:dbname=MyDbName;host=localhost';
$user = 'root';
......