PHP smartyѧϰ
phpÎļþ
<?php
mysql_connect("localhost","","");
mysql_query("set names 'gb2312'");
mysql_select_db("shop");
$sqlstr="select * from goods";
require 'smarty/libs/Smarty.class.php';
$smarty = new Smarty;//ÉèÖø÷¸öĿ¼µÄ·¾¶£¬ÕâÀïÊÇ°²×°µÄÖصã
$smarty->template_dir ="smarty/templates/templates";//ÔÚÏîÄ¿¸ùĿ¼ÏÂÃ潨´ËÎļþ¼Ð
$smarty->compile_dir ="smarty/templates/templates_c";
$smarty->config_dir = "smarty/templates/config";
$smarty->cache_dir ="smarty/templates/cache";
//smartyÄ£°åÓиßËÙ»º´æµÄ¹¦ÄÜ£¬Èç¹ûÕâÀïÊÇtrueµÄ»°¼´´ò¿ªcaching£¬µ«ÊÇ»áÔì³ÉÍøÒ³²»Á¢¼´¸üеÄÎÊÌ⣬µ±È»Ò²¿ÉÒÔͨ¹ýÆäËûµÄ°ì·¨½â¾ö
$smarty->caching = false;
$exec=mysql_query($sqlstr);
$rs=mysql_fetch_object($exec);
$arr=array();
$thenumber=0;
while($rs)
{
$arr2=array();
$arr2[0]=$rs->goodsname;
$arr2[1]=$rs->price;
$arr[$thenumber]=$arr2;
$rs=mysql_fetch_object($exec);
$thenumber=$thenumber+1;
}
$smarty->assign("guests",$arr); //$arrΪ¶þάÊý×飬½«Ëü¸³¸øÄ£°åÖеÄ$guest±äÁ¿
$smarty->display('index.tpl');
?>
tplÎļþ
<!DOCTYPE HTML PUBLIC "-//W3C//DTDHTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<metahttp-equiv="Content-Type" content="text/html;charset=gb2312">
<title>Smarty</title></head>
<body>
<table border="1">
{foreach from = $guests item=guest} //itemΪѡÏîÈ¡Ãû
<tr>
<td>{$guest.0}</td> //$guestÓëitemµÄÖµÏàͬ£¬0Óë$arr2[0]Ïàͬ¡£
<td>{$guest.1}</td>
</tr>
{/foreach}
</table>
</body>
</html>
Ïà¹ØÎĵµ£º
#apt-get install apache2
//°²×°apahce2
#apt-get install php5
//°²×°php5
#apt-get install mysql-server
//°²×°mysql·þÎñ¶Ë
#apt-get install mysql-myclient
//°²×°mysqlµÄ¿Í»§¶Ë
#apt-get install php-mysql
//°²×°php-mysqlµÄÁ¬½á
apache+php+mysql »·¾³ÒѾ´î½¨ºÃÁË
½«ÒÔϵķþÎñÖØÆôÒ»ÏÂ
#/et ......
<?php
/*
ͼƬ´¦Àíº¯Êý¹¦ÄÜ£ºËõ·Å¡¢¼ôÇС¢Ïà¿ò¡¢Ë®Ó¡¡¢Èñ»¯¡¢Ðýת¡¢·×ª¡¢Í¸Ã÷¶È¡¢·´É«
´¦Àí²¢±£´æÀúÊ·¼Ç¼µÄ˼·£ºµ±ÓÐͼƬÓиĶ¯Ê±×Ô¶¯Éú³ÉÒ»ÕÅÐÂͼƬ£¬ÃüÃû·½Ê½¿ÉÒÔ¿¼ÂÇÔÚÔͼƬµÄ»ù´¡ÉϼÓÉϲ½Ö裬ÀýÈ磺ͼƬÃû³Æ+__µÚ¼¸²½
*/
class picture{
var $PICTURE_URL;//Òª´¦ÀíµÄͼƬ
var $DEST_URL="temp__01.jpg" ......
ÀÏÁÎÔø¾ÔÚPHPERÔÓÖ¾ÉÏ·¢±í¹ýһƪÎÄÕ½Ð×öÓÃVIM×öPHP¿ª·¢»·¾³,ÔÚÀïÃæÏêϸ½éÉÜÁËÓÃVIM×öphp¿ª·¢ÐèÒª×öµÄ×¼±¸,ÕâƪÎÄÕ¾ͽáºÏһЩ×ÊÁϺÍÎÒ×Ô¼ºµÄһЩ¾ÑéÀ´½éÉÜÏÂÓÃVIM×öC/C++¿ª·¢ÐèÒª×öµÄÊÂÇé,Ïà¶ÔÀ´ËµÒª±È×öphp¿ª·¢·½±ãЩ¡£
Ç°ÌáÌõ¼þÊǵ±È»ÊÇÄãÒѾÏÂÔØÁËVIM,Èç¹ûûÓеĻ°ÇëÏȵ½¹Ù·½ÍøÕ¾ÏÂÔØ×îа汾,µØÖ·ÊÇ£ºhttp:/ ......
php°²×°³ÌÐòÔÀí£º
ÆäʵPHP³ÌÐòµÄ°²×°ÔÀíÎ޷ǾÍÊǽ«Êý¾Ý¿â½á¹¹ºÍÄÚÈݵ¼Èëµ½ÏàÓ¦µÄÊý¾Ý¿âÖУ¬´ÓÕâ¸ö¹ý³ÌÖÐÖØÐÂÅäÖÃÁ¬½ÓÊý¾Ý¿âµÄ²ÎÊýºÍÎļþ£¬ÎªÁ˱£Ö¤²»±»±ðÈ˶ñÒâʹÓð²×°Îļþ£¬µ±°²×°Íê³ÉºóÐèÒªÐ޸ݲװÎļþ¡£
²½Ö裺
¼ì²éĿ¼»òÎļþµÄȨÏÞ
Ð޸ĻòÌî¼ÓÅäÖÃÎļþ
¼ì²éÅäÖÃÎļþÕýÈ·ÐÔ
µ¼ÈëÊý¾Ý¿â
Ëø¶¨»òÉ ......
²Î¿¼×ÊÁÏ£º
1.
2. http://www.phpeclipse.com/wiki/Howto/XDebugAndPHPEclipse
1.ÏÂÔØXDebug http://xdebug.org/download.php
Ñ¡ÔñÓÚPHP°æ±¾Ïà¶ÔÓ¦µÄµÄ 5.2 VC6 (32 bit) ÏÂÔØ£¬¸ÄÃû³Éphp_xdebug.dllºó¸´ÖƵ½E:/APMServ5.2.6/PHP/ext/ÖÐ
2£® ÔÚphp.iniÖÐÌí¼ÓÒÔÏÂÄÚÈÝ£¬²¢½«zendµÄÆäËûÓ¦Óùصô£¨×¢Ê͵ôÆäËûzend_extens ......