php Á¬½ÓÊý¾Ý¿âµÄÀà
<?php
class Access//AccessÊý¾Ý¿â²Ù×÷Àà
{
var $databasepath,$constr,$dbusername,$dbpassword,$link;//ÀàµÄÊôÐÔ
function Access($databasepath,$dbusername,$dbpassword)//¹¹Ô캯Êý
{
$this->databasepath=$databasepath;
$this->username=$dbusername;
$this->password=$dbpassword;
$this->connect();
}
function connect()//Êý¾Ý¿âÁ¬½Óº¯Êý
{
$this->constr="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath($this->databasepath);
$this->link=odbc_connect($this->constr,$this->username,$this->password,SQL_CUR_USE_ODBC);
return $this->link;
//if($this->link) echo "¹§Ï²Äã,Êý¾Ý¿âÁ¬½Ó³É¹¦!";
//else echo "Êý¾Ý¿âÁ¬½Óʧ°Ü!";
}
function query($sql)//ËÍÒ»¸ö²éѯ×Ö·û´®µ½Êý¾Ý¿âÖÐ
{
return @odbc_exec($this->link,$sql);
}
function first_array($sql)//´ÓaccessÊý¾Ý¿âÖзµ»ØÒ»¸öÊý×é
{
return @odbc_fetch_array($this->query($sql));
}
function fetch_row($query)//·µ»Ø¼Ç¼ÖеÄÒ»ÐÐ
{
return odbc_fetch_row($query);
}
function total_num($sql)//È¡µÃ¼Ç¼×ÜÊý
{
return odbc_num_rows($this->query($sql));
}
function close()//¹Ø±ÕÊý¾Ý¿âÁ¬½Óº¯Êý
{
odbc_close($this->link);
}
function insert($table,$field)//²åÈë¼Ç¼º¯Êý
{
$temp=explode(',',$field);
$ins='';
for ($i=0;$i<count($temp);$i++)
{
$ins.="'".$_POST[$temp[$i]]."',";
}
$ins=substr($ins,0,-1);
$sql="INSERT INTO ".$table." (".$field.") VALUES (".$in
Ïà¹ØÎĵµ£º
½ñÌìÓöµ½ÁËÒ»¸ö¹ÖÎÊÌ⣬ÎÒÓÃ$fp=fopen("access_log.txt","ab")´ò¿ªÒ»¸öÎļþºó¿ªÊ¼ÍùÀïÃæÐ´Êý¾Ý£¬Ð´µÄÄÚÈÝÊÇ 'XXX\nXXX\n'£»
µ«ÊÇÆæ¹ÖµÄÊÇ ²»¹ÜÎÒÔõôÍùÀïÃæÐ´ ËûÊDz»»»ÐÐ,¼Çʱ¾Àï¼Ç¼µÄÊý¾Ý ¾ÍÊÇ 'xxx\nxxx\n'£¬
ºÜÊÇÄÕ»ð£¬È¥ÍøÉÏËѼ¯×ÊÁÏ£¬ÓеÄ˵¸Ä³É'\r\n'ʲôµÄ£¬½á¹ûÊÇд½øÈ¥ºó»¹ÊÇ 'xxx\r\nxx ......
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 92160 bytes) in :\Inetpub\wwwroot04\test.php on line 8
Fatal error: Out of memory (allocated 259,260,416) (tried to allocate 16 bytes) in C:\Inetpub\wwwroot04\test.php on line 8
//ini_set('memory_limit', '-1');
$inde ......
Win2003server ϼÜÉèPHPWind²úÆ·»·¾³
°²×°Ç°×¼±¸:1¡¢°²×°ºÃiis6
&nbs ......
ÔÚphpÖз¢ËÍÓʼþ¿ÉÒÔÓÃ×Ô´øµÄmail()º¯Êý£¬µ«ÊÇÕâ¸öº¯Êý²»×ãµãºÜÃ÷ÏÔ£¬×îÖ÷ÒªÊÇÔÛ±¾»úÉÏûÓа²×°smtp·þÎñ¾Íû·¨Ê¹ÓÃmail()¡£
µ±È»ÏÖÔÚ»¹ÓÐphpÆäËûµÄ²å¼þ¡¢ÀàʲôµÄ£¬ÄÇЩҲÐí¹¦ÄÜÆëÈ«£¬¿ÉÊÇÍâ¼Ó¾Í¸Ð¾õ²»Ë¬¡£
ÄÇÆäËû°ì·¨µÄ»°£¬Ò»°ã»áÏ뵽ͨ¹ýSMTP·þÎñÆ÷À´·¢ËÍÓʼþ£¬µ«ÊÇÒ²»á²úÉúһϵÁÐÎÊÌ⣨¾ßÌåÓÐÄÄЩÎÊÌâ¿É¼û²Î¿¼×ÊÁÏ"ÎÞÐ ......
1¡¢¹ýÂ˱êÇ©(HTML)£ºstrip_tags()
ÀýÈ磺
<?php
$text = '<?php ?><p>Test paragraph.</p><!-- Comment -
-> <a href=http://topic.csdn.net/u/20090311/09/"#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";
// ÔÊÐíʹÓÃ<p>ºÍ<a>
echo stri ......