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

PHPСʵÀý ÖÆ×÷ÁôÑÔ±¾

PHPСʵÀý-ÖÆ×÷ÁôÑÔ±¾
µÚÒ»²½£ºÔÚmysqlÖÐн¨Êý¾Ý¿âbbs È»ºóÖ´ÐÐsql´úÂë
CREATE TABLE `message` (
`id` tinyint(1) NOT NULL auto_increment,
`user` varchar(25) NOT NULL,
`title` varchar(50) NOT NULL,
`content` tinytext NOT NULL,
`lastdate` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk AUTO_INCREMENT=1 ;
ÔËÐгɹ¦ºó ÈçÏÂͼËùʾ£º
µÚ¶þ²½£ºÐ½¨conn.php
<?php
$conn = @ mysql_connect("localhost", "root", "") or die("Êý¾Ý¿âÁ´½Ó´íÎó");
mysql_select_db("bbs", $conn);
mysql_query("set names 'GBK'"); //ʹÓÃGBKÖÐÎıàÂë;
function htmtocode($content){
$content = str_replace("\n","<br>",str_replace(" ","&nbsp;",$content));
return $content;
}
?>
µÚÈý²½£ºÐ½¨add.php
<?php
include("conn.php");
if($_POST['submit'])
{
$sql="insert into message (id,user,title,content,lastdate)" .
"values ('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
mysql_query($sql);
echo "<script language=\"javascript\">alert('Ìí¼Ó³É¹¦');history.go(-1)</script>";
}
?>
<script language="javascript">
function checkpost()
{
if (myform.user.value=="")
    {
     alert("ÇëÊäÈëÓû§Ãû");
myform.user.focus();
return false;
    }
if (myform.title.value.length<5)
    {
     alert("±êÌâ²»ÄÜСÓÚ5¸ö×Ö·û");
myform.title.focus();
return false;
    }
     if (myform.content.value.length<5)
    {
     alert("ÁôÑÔÄÚÈݲ»ÄÜСÓÚ10¸ö×Ö·û");
myform.content.focus();
return false;
     }
}
</script>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style>
<form name="myform" action="add.php" method="post" onsubmit="return checkpost();">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
   


Ïà¹ØÎĵµ£º

phpÖÐÈçºÎ¹Ø±Õnotice¼¶µÄ´íÎóÌáʾ

phpÖÐÈçºÎ¹Ø±Õnotice¼¶µÄ´íÎóÌáʾ
2008-09-04 15:39
1.ÔÚphp.iniÎļþÖиĶ¯error_reporting
   ¸ÄΪ£º   
   error_reporting    =    E_ALL    &    ~E_NOTICE
Èç¹ûÄã²»ÄܲÙ×÷php.iniÎļþ£¬Äã¿ÉÒÔÓÃÏÂÃæµÄ·½·¨ ......

PHPµÄMVCʵÏÖ

¸ÕѧPHPµÄMVC,ÍøÉÏÕÒÀ´µãÎÄÕÂѧϰ,·ÖÏíÏÂ
      ASP£¬JSP£¬PHPÊÇWEB¿ª·¢µÄÈý´ó¼¼Êõ£¬ÈýÖÖ¼¼ÊõÓÅȱµãÒ²Ôç¾ÍÓÐÈË·ÖÎö¹ýÁË¡£ÎÞ·ÇÒ²¾ÍÊÇASP¼òµ¥Ò×ÓÃÇÒÓÐmicrosoft×ö¿¿É½£¬JSP¹¦ÄÜÇ¿´óÊÇÒòΪÓÐjavaÖ§³Ö£¬PHPÔò¿ªÔ´¿çƽ̨¡£ÔÚ¹úÄÚ£¬ASPÓ¦Ó÷¶Î§×î¹ã£¬JSP·¢Õ¹ÊÆÍ·×îÃÍ£¬PHPÔò´¦ÓÚÁÓÊÆ¡£Õâ¿ÉÄÜÓë¹«Ë ......

PHP¶ÁÈ¡MSSQLÊý¾Ý³öÏÖÂÒÂëµÄÎÊÌâ

PHP¶ÁÈ¡MYSQLÊý¾Ý¿â»òMSSQLÊý¾Ý¿âʱ£¬ÓÐʱ³öÏÖÂÒÂ룬ÕâÊÇPHP.iniÖÐÅäÖúÍ.phpÒ³Ãæ±àÂë²»Ò»ÖÂÒýÆðµÄ¡£
½â¾ö°ì·¨£º
1¡¢Ê×ÏÈ£¬½«PHP.iniÖÐÉèÖÃΪdefault_charset = "gb2312"£¬È»ºóÖØÆôApache¡£
   Õâʱ´ÓÊý¾Ý¿âÖÐÌáÈ¡µÄ½á¹û¼¯¿ÉÒÔÕý³£ÏÔʾÖÐÎÄÁË£¬µ«.phpÒ³ÃæÖеÄÁÐÃûÒ²ÓпÉÄÜÏÔʾÂÒÂëÁË¡£ÕâÑù½â¾ö£¬
2¡¢È»ºó£¬PH ......

httpOnly cookie flag support in PHP 5.2

http://ilia.ws/archives/121-httpOnly-cookie-flag-support-in-PHP-5.2.html
Thanks to a patch from Scott
MacVicar that I've just applied to CVS, PHP 5.2 will have support for
httpOnly cookie flag. This neat little feature allows you to mark a
newly created cookie as HTTP only, another words inacce ......

³£ÓÃPHPº¯Êý

ÕâÊÇһЩʹÓÃƵÂʱȽϸߵĺ¯Êý£¬ÓеÄÀ´×Ô±ðÈ˵ijÌÐò......
1.²úÉúËæ»ú×Ö·û´®º¯Êý
function random($length) {
 $hash = '';
 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
 $max = strlen($chars) - 1;
 mt_srand((double)microtime() * 1000000);
 for($ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ