http://www.wretch.cc/blog/black74822/17173459
- 5月 01 週三 201309:05
驗證碼
- 3月 14 週四 201320:56
php14:從文字檔中撈e-mail寄信
1. 用無限循環來撈文字檔內的資料
<?php
$fo=fopen("mailFromTxt.txt","r");
do{
echo fgets($fo);
fclose($fo);
}
while (!feof($fo))//如果不是檔案的結尾就進行do內的迴圈,feof=file end of file
<?php
$fo=fopen("mailFromTxt.txt","r");
do{
echo fgets($fo);
fclose($fo);
}
while (!feof($fo))//如果不是檔案的結尾就進行do內的迴圈,feof=file end of file
- 3月 14 週四 201319:58
如何從mysql撈資料顯示在網頁上

語法:
<?php
mysql_connect("localhost","root","密碼");//與localhost連線、root是帳號、密碼處輸入自己設定的密碼
mysql_select_db("member");//我要從member這個資料庫撈資料
mysql_query("set names utf8");//設定utf8 中文字才不會出現亂碼
$data=mysql_query("select * from member");//從member中選取全部(*)的資料
$rs=mysql_fetch_row($data);//擷取資料的第一行,此句打兩次就會出現第二行,打三次出現第三行...
echo $rs[1]//將 $rs的第一欄顯示在畫面上
?>
- 3月 13 週三 201323:08
資料庫使用~資料庫和資料表

1. 之前已經安裝好了(看PHP1),在網址列輸入localhost,點入第一個phpMyAdmin
2. 點入後會跳出下表,帳號是root,密碼填當初安裝設的密碼,密碼忘記請重新安裝。
- 3月 13 週三 201322:53
如何得知本機的IP

1. 在開始的地方,搜尋列輸入cmd,點入cmd。
2. 在閃爍底線處輸入ipconfig,按enter,隨即出現多行字,其中就有IP
- 3月 13 週三 201319:48
php13:網友需入意見後,傳送給站長,三分鐘只能傳一次
1. 目的如標題
2.在header程式碼的最上面輸入
<?php
if($_COOKIE['value']!="true"){
if(isset($_POST['name'])){//寫此段if的目的是為了防止一進入網頁信就發送出去,所以寫如果網友有填name的格子才進行以下動作
mb_internal_encoding("utf-8");
$to="XXXXXXX@gmail.com";
$subject=mb_encode_mimeheader($_POST['name'],"utf-8");
$message=$_POST['suggesion'];
$headers="MIME-Version: 1.0\r\n";
$headers.="Content-type: text/html; charset=utf-8\r\n";
$headers.="From:".mb_encode_mimeheader($_POST['name'],"utf-8")."<".$_POST['mail'].">"."\r\n";
mail($to,$subject,$message,$headers);
setcookie("value","true",time()+180);
}
}
2.在header程式碼的最上面輸入
<?php
if($_COOKIE['value']!="true"){
if(isset($_POST['name'])){//寫此段if的目的是為了防止一進入網頁信就發送出去,所以寫如果網友有填name的格子才進行以下動作
mb_internal_encoding("utf-8");
$to="XXXXXXX@gmail.com";
$subject=mb_encode_mimeheader($_POST['name'],"utf-8");
$message=$_POST['suggesion'];
$headers="MIME-Version: 1.0\r\n";
$headers.="Content-type: text/html; charset=utf-8\r\n";
$headers.="From:".mb_encode_mimeheader($_POST['name'],"utf-8")."<".$_POST['mail'].">"."\r\n";
mail($to,$subject,$message,$headers);
setcookie("value","true",time()+180);
}
}
- 3月 13 週三 201309:43
php:mail 出現問題
Warning: mail() [function.mail]: SMTP server response: 550 Relaying mail to XXXXXX@gmail.com is not allowed in C:\AppServ\www\Winnie\mail.php on line 10
- 3月 13 週三 201309:12
各ISP的SMTP
各ISP的SMTP
各ISP的SMTP資料:
中華電信
SMTP:msa.hinet.net
port:25
台灣大哥大
SMTP:smtp.tcc.net.tw
port:25
遠傳電信
SMTP:smtp.fetnet.net
port:25
apol 亞太線上
SMTP:smtp.apol.com.tw
port:25
轉自:http://xyz.cinc.biz/2012/02/ispsmtp.html
各ISP的SMTP資料:
SMTP:msa.hinet.net
port:25
SMTP:smtp.tcc.net.tw
port:25
SMTP:smtp.fetnet.net
port:25
SMTP:smtp.apol.com.tw
port:25
轉自:http://xyz.cinc.biz/2012/02/ispsmtp.html
- 3月 12 週二 201322:49
php12:利用php發信
1. 更改php.ini檔案(在C槽的windows下),更改SMTP(Simple Mail Transfer Protocol)
將SMTP = localhost
改為SMTP = msa.hinet.net
將SMTP = localhost
改為SMTP = msa.hinet.net