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

ÓÃÄ£°å¼¼ÊõʵÏÖPHP´úÂëºÍHMTL´úÂë·ÖÀë

1¡¢Ä£°åµÄÓÉÀ´
ÔÚûÓÐÄ£°å¼¼Êõ֮ǰ£¬Ê¹ÓÃPHP¿ª·¢³ÌÐò£¬Í¨³£¶¼ÊÇphp´úÂëºÍhtml»ì±àÔÚÒ»Æð¡£±ÈÈç˵ÐÂÎÅÁÐ±í£¬ºÜ¿ÉÄܾÍÊÇÒ»¸önewslist.phpÒ³Ã棬½á¹¹ÈçÏ£º
<?
//´ÓÊý¾Ý¿âÖжÁÈ¡³öÒªÏÔʾµÄÐÂÎżÇ¼
?>
<html>
<head>……..
</head>
<body>
<?
While ($news = mysql_fetch_array($result)) {
?>
<!--Êä³öÐÂÎűêÌâ -- >
<?
}
?>
</body>
</html>
ÄÇôÕâÑùÓÐʲôÎÊÌâÄØ£¿Ê×ÏÈ£¬²»ÀûÓÚ·Ö¹¤ºÏ×÷¡£Ò»°ãÀ´Ëµ£¬¶¼»áÓɳÌÐòÔ±À´Ð´´úÂ룬ÃÀ¹¤ÈËÔ±Éè¼ÆÒ³Ãæ¡£ÄÇôÔÚÕâÖÖ·½Ê½ÖУ¬³ÌÐòÔ±±ØÐëµÈ´ýÃÀ¹¤ÈËÔ±°Ñ½çÃæÉè¼ÆºÃ²ÅÄÜ¿ªÊ¼¹¤×÷¡£Ò²¾ÍÊÇ˵³ÌÐòÔ±ºÍÃÀ¹¤µÄ¹¤×÷ÊDz»ÄÜͬ²½µÄ¡£Æä´Î¡¢²»ÀûÓÚά»¤£¬¿Éά»¤ÐԲ±ÈÈç˵³ÌÐò¹Ì¶¨ºó£¬ÒªÐ޸ĽçÃ棬ÄÇô±ØÐëÓÉÃÀ¹¤Ð޸ĺ󣬳ÌÐòÔ±ÔÙÖØÐÂÌí¼Ó¡£×îºó£¬³ÌÐò½á¹¹»ìÂÒ£¬¿É¶ÁÐԲHTMLºÍPHP»ì±àÔÚÒ»Æð£¬Ò»µ©³ÌÐòÒ»¶à£¬¾Í»á±äµÄ·Ç³£µÄÁèÂÒ¡£
Àí½âÄ£°åÔ­À헗ʹÓÃPHP±êÇ©µÄÄ£°å¼¼Êõ
Ä£°å¼¼ÊõÕýÊÇΪÁ˽â¾öÕâЩÎÊÌâ¶ø³öÏֵģ¬ÎªÁ˽â¾öÕâЩÎÊÌ⣬×îÔç³öÏÖµÄÊÇʹÓÃphp±êÇ©µÄÄ£°å¼¼Êõ¡£
Ê×ÏÈ£¬ÎÒÃÇÒªÃ÷°×Ä£°åµÄÄ¿µÄÊÇʲô¡£Ä£°åÖ÷ҪҪʵÏÖ¼¸¸öÈÎÎñÄØ£¿µÚÒ»¡¢ÃÀ¹¤ºÍ³ÌÐòµÄ·ÖÀë¡£¸üÈ·ÇеÄ˵·¨ÊÇ»ñÈ¡Êý¾ÝºÍÏÔʾÊý¾ÝµÄ·ÖÀë¡£µÚ¶þ¡¢·Ö¹¤¡£Á¼ºÃµÄ·Ö¹¤ºÏ×÷¡£
±ÈÈç˵ÐÂÎÅÁÐ±í£¬Èç¹ûʹÓÃÄ£°å£¬ÎÒÃǾͿÉÒÔ°ÑÐÂÎÅÁбíµÄ²Ù×÷·Ö³ÉÁ½²¿·Ö£º
1¡¢ getnews.php ¸ºÔð´ÓÊý¾Ý¿âÖжÁÈ¡Êý¾Ýµ½Êý×é$newsÖУ¬²»¹ØÐÄ$newsÊÇÈçºÎÏÔʾµÄ¡£
2¡¢ Shownews.php ¸ºÔð°Ñ$newsÊý×éÊä³ö³ÉHTMLÒ³Ãæ¡£¶øËü²»ÐèÒªÀí»á$newsÊÇ´ÓÄÄÀïÀ´µÄ¡£
ºÃ£¬ÕâÑù£¬ÎÒÃǾÍʵÏÖÁËÃÀ¹¤ºÍ³ÌÐòµÄ·ÖÀ룬´ïµ½ÁËÎÒÃǵijõ²½Ä¿µÄ£¬µ«ÊÇÈçºÎ°ÑÕâÁ½¸öÒ³ÃæÁªºÏÆðÀ´£¬²¢ÊµÏÖlistnews.phpµÄ¹¦ÄÜÄØ£¿
Õâ¾ÍÐèÒªÁíÍâÒ»¸öÒ³Ãælistnews.php£¬À´¸ºÔð°Ñ“ÃÀ¹¤£¨ÏÔʾÊý¾Ý£©”ºÍ“³ÌÐòÔ±£¨»ñÈ¡Êý¾Ý£©”Á¬½ÓÆðÀ´¡£Ó¦¸Ã˵Õâ¸öÒ³Ãæ¾ÍÊǺܼòµ¥ÁË¡£
¼ÙÉègetnews.phpµÄ´úÂëÈçÏ£º
<?
$news =“ÐÂÎÅÁбí”;//ʵ¼ÊÖÐÓ¦¸ÃÊÇ´ÓÊý¾Ý¿âÖжÁÈ¡³öÀ´µÄ¡£
?>
Shownesw.phpµÄ´úÂëÈçÏ£º
<html>
<head>
<title>ÏÔʾÐÂÎÅ</title>
</head>
<body>
<?=$news?>
</body>
</html>
ÄÇô£¬Õâ¸öÁªºÏÒ³Ãælistnews.phpµÄ´úÂë¾ÍºÜ¼òµ¥ÁË
<?
Include(‘getnews.php');//»ñÈ


Ïà¹ØÎĵµ£º

PHPnow = Apache + PHP + MySQL + phpMyAdmin

 
PHPnow ÊÇʲô?
Win32 ÏÂÂÌÉ«Ãâ·ÑµÄ Apache + PHP + MySQL »·¾³Ì×¼þ°ü¡£
¼òÒ×°²×°¡¢¿ìËٴ֧³ÖÐéÄâÖ÷»úµÄ PHP »·¾³¡£¸½´ø PnCp.cmd ¿ØÖÆÃæ°å£¬°ïÖúÄã¿ìËÙÅäÖÃÄãµÄÌ×¼þ£¬Ê¹Ó÷dz£·½±ã¡£
PHPnow ÊÇÂÌÉ«µÄ£¬½âѹºóÖ´ÐÐ Init.cmd ³õʼ»¯£¬¼´¿ÉµÃµ½Ò»¸ö PHP + MySQL »·¾³¡£
È»ºó¾Í¿ÉÒÔÖ±½Ó°²×° Discuz!, PHPWind, ......

javaºÍphpÊý×Ö´¦ÀíÉÏ

javaʹÓÃMathÀ࣬phpʹÓÃϵͳº¯Êý
ceil¹¦ÄÜ ´óÓÚµÈÓÚijÊý(³£ÓÃÓÚ·ÖÒ³Ò³Êý¼ÆË㣩
phpÖУºceil(a/b)
javaÖУº(int)Math.ceil((double)a/b))    Math.ceilÔÚjavaÖÐÐèÒª´«ÈëdoubleÐÍ£¬¶ø·µ»ØÒ²ÊÇdoubleÐÍ¡£×¢ÒâÕâÀïÓÃ(double)a/b²Å¿ÉÒÔ¡£
a/b,(dobule)(a/b)¶¼²»ÐС£ÒòΪËûÃÇ»áÏÈ×Ô¶¯ÉáÆúСÊýÈ¡µÃÕûÊý
flooe ......

PHPºÍflex½»»¥ÂÒÂë

 Õâ¸öÔ­ÒòÓÐÒÔϼ¸¸ö£º
µÚÒ»£¬ÔÚphpÖеÄÄÚÈݲ»ÊÇÓÃutf-8½øÐбàÂëµÄ£¬¿ÉÒÔÔÙphpÍ·²¿Ìí¼Ó£ºheader("Content-Type:text/html;charset=utf-8");
µÚ¶þ£¬phpÎļþ±¾Éí²»ÊÇutf-8±àÂëµÄ£¬Õâ¿ÉÒÔ¸ü¸Äzend-studio£¬µÄÎļþ±àÂë¸ñʽ£¬Ö¸¶¨Îªutf-8·½·¨ÊÇ£ºwindw->preference->General->Workspace->Text file ......

apache php ³£¼ûÎÊÌâ

 linuxÏÂapache+php°²×°³£¼ûÎÊÌâ configure: error: Unable to find libgd.(a|so)
Èç¹ûʹÓõÄÊÇubuntu»òdebian¾ÍºÜ¼òµ¥ÁË£¬Ö±½Ósudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd ¾Í»ù±¾Éϸ㶨£¬µ«ÊÇÓÃÔ´´úÂë°²×°»¹ÊǺÜÂé·³¡«
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0 ......

php»ñÈ¡»·¾³ÐÅÏ¢

ϵͳ°æ±¾±È½Ï
mixed version_compare ( string version1, string version2 [, string operator] )
version_compare('5.1','<');  //±È½Ïµ±Ç°°æ±¾ÊÇ·ñСÓÚ5.1
ÊÇ·ñ¿ªÆô×Ô¶¯/
get_magic_quotes_gpc() 
return 1 on: will add slash.
return 0 off:willn't add.
if(get_magic_quotes_gpc()) {
 $cm ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ