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

[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');
?>


Ïà¹ØÎĵµ£º

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  
   
  ......

phpÖе¥ÒýºÅºÍË«ÒýºÅÇø±ð

1 PHPÖе¥ÒýºÅÓëË«ÒýºÅµÄÇø±ð  
¡¡¡¡ÔÚPHPÖУ¬Í¨³£Ò»¸ö×Ö·û´®±»¶¨ÒåÔÚÒ»¶ÔÒýºÅÖУ¬È磺
'I am a string in single quotes'
"I am a string in double quotes"
¡¡¡¡PHPÓï·¨·ÖÎöÆ÷ÊÇÓóɶԵÄÒýºÅÀ´ÅжÏÒ»¸ö×Ö·û´®µÄ¡£Òò´Ë£¬ËùÓÐ×Ö·û´®±ØÐëʹÓÃͬһÖÖµ¥»òÕßË«
ÒýºÅÀ´¶¨Ò忪ʼºÍ½áÊø¡£ÀýÈ磬ÏÂÃæµÄ×Ö´®¶¨ÒåÊ ......

PHPÓû§µÇ¼ע²áÄ£¿éʵÏÖ


PHPÓû§µÇ¼ģ¿éʵÏÖ
ÏîÄ¿°üº¬µÄ¹¦Äܽű¾£º
login.php//怬
reg.php//×¢²áÓû§
user_add.php//×¢²áУÑé½Å±¾
user_login_check.php//µÇ¼УÑé½Å±¾
image.php//ÑéÖ¤ÂëͼƬÉú³É½Å±¾
Á÷³Ì£º
Éè¼ÆÊý¾Ý¿â£º
°üº¬Óû§uid£¬Óû§Ãû£¬ÃÜÂ룬êdzƣ¬ÐÔ±ð£¬ÓÊÏ䣬ע²áʱ¼ä
sqlÓï¾äÈçÏÂ
create table users (uid bigint(20) ......

[PHP]PDOµÄʹÓÃ

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';
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ